ColumnPath

data class ColumnPath(val path: List<String>) : List<String> , ColumnAccessor<Any?>

Path to a column in DataFrame.

Stores a list of column names that are used to retrieve columns through a chain of column groups.

Constructors

Link copied to clipboard
constructor(path: List<String>)
constructor(name: String)

Types

Link copied to clipboard
internal object Companion

Properties

Link copied to clipboard
Link copied to clipboard
internal val ColumnReference<*>.name: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val size: Int

Functions

Link copied to clipboard
Link copied to clipboard
internal inline fun ColumnsResolver<*>.allAfterInternal(crossinline colByPredicate: ColumnFilter<*>): ColumnSet<*>

Returns a new ColumnSet containing all columns after the first column that matches the given predicate.

Link copied to clipboard
internal inline fun ColumnsResolver<*>.allBeforeInternal(crossinline colByPredicate: ColumnFilter<*>): ColumnSet<*>

Returns a new ColumnSet containing all columns before the first column that satisfies the given predicate.

Link copied to clipboard

Returns a new ColumnSet that contains all columns from inside the receiver column group except those specified in the "other" ColumnsResolver.

Link copied to clipboard

Returns a new list of column paths, except the ones inside columns. NOTE: The structure is not kept the same; if a column is removed, its parent will be removed as well, and all its siblings will be lifted out of the group. This also happens if a column is "removed" that does not exist in this.

Link copied to clipboard
internal fun List<ColumnWithPath<*>>.allColumnsExceptKeepingStructure(columns: Set<ColumnWithPath<*>>, removeEmptyGroups: Boolean = true): List<ColumnWithPath<*>>

Returns a new list of column paths, except the ones inside columns. NOTE: ColumnGroups are adapted to keep their structure. If a column inside a column group is excepted, it will be removed from the group. Empty groups will be removed if removeEmptyGroups== true

Link copied to clipboard

If this is a SingleColumn containing a single ColumnGroup (like SingleColumn<AnyRow> or ColumnsSelectionDsl), it returns a (transformable) ColumnSet containing the children of this ColumnGroup, else it simply returns a (transformable) ColumnSet from this (like when this is a ColumnSet).

Link copied to clipboard
internal inline fun ColumnsResolver<*>.allFromInternal(crossinline colByPredicate: ColumnFilter<*>): ColumnSet<*>

Returns a column set containing all columns from the internal column set that satisfy the given predicate.

Link copied to clipboard
internal inline fun ColumnsResolver<*>.allUpToInternal(crossinline colByPredicate: ColumnFilter<*>): ColumnSet<*>

Returns a ColumnSet containing all columns up to (and including) the first column that satisfies the given predicate.

Link copied to clipboard
internal fun <T> Iterable<T>.anyNull(): Boolean
Link copied to clipboard
@JvmName(name = "asColumnGroupDataRow")
fun <C> SingleColumn<DataRow<C>>.asColumnGroup(): SingleColumn<DataRow<C>>

Creates a ColumnAccessor<DataRow<C>> from this. This is especially useful when you want to use ColumnGroup functions in the ColumnsSelectionDsl but your column type is not recognized as a ColumnGroup. If you're not sure whether a column is recognized as ColumnGroup or not, you can always call asColumnGroup and it will return the same type if it is already a ColumnGroup.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <T> Iterable<T>.asList(): List<T>
Link copied to clipboard
@JvmName(name = "asNumbersAnyNullable")
fun SingleColumn<Any?>.asNumbers(): SingleColumn<Number?>
@JvmName(name = "asNumbersAny")
fun SingleColumn<Any>.asNumbers(): SingleColumn<Number>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
internal fun Iterable<Any?>.classes(): Set<KClass<*>>

Returns a set containing the KClass of each element in the iterable.

Link copied to clipboard
internal fun <D> List<ColumnWithPath<*>>.collectTree(emptyData: D, createData: (AnyCol) -> D): TreeNode<D>
Link copied to clipboard

Returns all columns inside this ColumnsResolver at any depth if they satisfy the given predicate.

Link copied to clipboard
internal inline fun ColumnsResolver<*>.colsInternal(crossinline predicate: ColumnFilter<*>): TransformableColumnSet<*>

If this ColumnsResolver is a SingleColumn, it returns a new ColumnSet containing the columns inside of this SingleColumn that match the given predicate.

Link copied to clipboard
inline fun <reified C> SingleColumn<DataRow<*>>.colsOf(noinline filter: (ColumnWithPath<C>) -> Boolean = { true }): ColumnSet<C>
fun <C> SingleColumn<DataRow<*>>.colsOf(type: KType, filter: (ColumnWithPath<C>) -> Boolean = { true }): ColumnSet<C>

Returns a ColumnSet of columns from this that are a subtype of the given type C, optionally filtered by filter.

Link copied to clipboard
internal inline fun <C> ColumnsResolver<*>.colsOfInternal(type: KType, crossinline filter: ColumnFilter<C>): TransformableColumnSet<C>

If this ColumnsResolver is a SingleColumn, it returns a new ColumnSet containing the columns inside of this SingleColumn that match the given filter and are the given type.

Link copied to clipboard
internal inline fun ColumnsResolver<*>.columnGroupsInternal(crossinline filter: (ColumnGroup<*>) -> Boolean): ColumnSet<DataRow<*>>

Returns a ColumnSet containing the column groups that satisfy the given filter.

Link copied to clipboard
internal inline fun ColumnsResolver<*>.columnsOfKindInternal(kinds: Set<ColumnKind>, crossinline filter: ColumnFilter<*>): TransformableColumnSet<*>

Returns a TransformableColumnSet containing the columns of given kind(s) that satisfy the given filter.

Link copied to clipboard
internal fun Iterable<KType?>.commonType(useStar: Boolean = true): KType

Returns the common supertype of the given types.

internal fun Iterable<KClass<*>>.commonType(nullable: Boolean, upperBound: KType? = null): KType
Link copied to clipboard
internal fun Iterable<KType>.commonTypeListifyValues(useStar: Boolean = true): KType

Returns the common type of the given types including "listify" behaviour. Values and nulls will be wrapped in a list if they appear among other lists. For example: [Int, Nothing?, List<Int>] will become List<Int> instead of Any?. If there is another collection in there, it will become Any? anyway.

Link copied to clipboard

Returns a DataColumn containing all values from the columns in this iterable.

Returns a DataFrame containing all rows from the DataFrames in this iterable.

@JvmName(name = "concatRows")
fun <T> Iterable<DataRow<T>?>.concat(): DataFrame<T>

Returns a DataFrame containing the rows in this iterable in iteration order.

Link copied to clipboard
open operator override fun contains(element: String): Boolean
Link copied to clipboard
open override fun containsAll(elements: Collection<String>): Boolean
Link copied to clipboard
@JvmName(name = "convertNullableIterableToUnifiedNumberType")
internal fun Iterable<Number?>.convertToUnifiedNumberType(options: UnifiedNumberTypeOptions = UnifiedNumberTypeOptions.DEFAULT, commonNumberType: KType? = null): Iterable<Number?>
@JvmName(name = "convertIterableToUnifiedNumberType")
internal fun Iterable<Number>.convertToUnifiedNumberType(options: UnifiedNumberTypeOptions = UnifiedNumberTypeOptions.DEFAULT, commonNumberType: KType? = null): Iterable<Number>

Converts the elements of the given iterable of numbers into a common numeric type based on complexity. The common numeric type is determined using the provided commonNumberType parameter or calculated with Iterable.unifiedNumberTypeOrNull from the iterable's elements if not explicitly specified.

Link copied to clipboard
Link copied to clipboard
internal fun Iterable<KClass<*>>.createType(nullable: Boolean, upperBound: KType? = null): KType
Link copied to clipboard
internal fun ColumnPath.depth(): Int
Link copied to clipboard
operator fun ColumnReference<Int>.div(value: Int): ColumnReference<Int>

Returns a ColumnReference containing the results of dividing each element of this ColumnReference by value.

Link copied to clipboard
fun drop(size: Int): ColumnPath
Link copied to clipboard
fun dropFirst(size: Int = 1): ColumnPath

Returns a shortened ColumnPath without the first size elements.

Link copied to clipboard
fun dropLast(size: Int = 1): ColumnPath

Returns a shortened ColumnPath without the last size elements.

Link copied to clipboard
internal fun ColumnPath.dropStartWrt(otherPath: ColumnPath): ColumnPath

Drops the overlapping start of the child path with respect to the parent path, and returns the resulting ColumnPath.

Link copied to clipboard

Checks the validity of this SingleColumn, by adding a check to see it's a ColumnGroup (so, a SingleColumn<*>) and throwing an IllegalArgumentException if it's not.

Link copied to clipboard

Checks the validity of this SingleColumn, by adding a check to see it's a FrameColumn (so, a SingleColumn<*>) and throwing an IllegalArgumentException if it's not.

Link copied to clipboard

Checks the validity of this SingleColumn, by adding a check to see it's a ValueColumn (so, a SingleColumn<*>) and throwing an IllegalArgumentException if it's not.

Link copied to clipboard
infix fun <C> ColumnReference<C>.eq(value: C): ColumnReference<Boolean>
Link copied to clipboard
internal fun <T> Iterable<T>.equalsByElement(other: Iterable<T>): Boolean
Link copied to clipboard
@JvmName(name = "exceptInternalSingleColumn")
internal fun <C> SingleColumn<DataRow<C>>.exceptInternal(other: ColumnsResolver<*>): SingleColumn<DataRow<C>>

Returns a new SingleColumn> that has the same structure as the receiver, but excludes columns specified in the "other" ColumnsResolver.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
internal fun ColumnsResolver<*>.flattenRecursively(includeGroups: Boolean = true, includeTopLevel: Boolean = true): ColumnsResolver<*>

Flattens a ColumnsResolver recursively.

Link copied to clipboard
internal inline fun ColumnsResolver<*>.frameColumnsInternal(crossinline filter: (FrameColumn<*>) -> Boolean): TransformableColumnSet<AnyFrame>

Returns a TransformableColumnSet containing the frame columns that satisfy the given filter.

Link copied to clipboard
open operator override fun get(index: Int): String
open operator override fun <C> get(column: ColumnReference<C>): ColumnAccessor<C>
Link copied to clipboard
internal fun <T> ColumnsResolver<T>.getAt(index: Int): SingleColumn<T>
Link copied to clipboard
internal fun List<Boolean>.getTrueIndices(): List<Int>
Link copied to clipboard
open operator override fun getValue(thisRef: Any?, property: KProperty<*>): ColumnAccessor<Any?>
open override fun getValue(row: AnyRow): Any?
Link copied to clipboard
open override fun getValueOrNull(row: AnyRow): Any?
Link copied to clipboard
Link copied to clipboard
open override fun indexOf(element: String): Int
Link copied to clipboard
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
open operator override fun iterator(): Iterator<String>
Link copied to clipboard
internal fun List<Code>.join(): String
Link copied to clipboard
fun <T> Iterable<DataFrame<T>>.joinOrNull(joinType: JoinType = JoinType.Inner, selector: JoinColumnsSelector<T, T>? = null): DataFrame<T>?

Joins all DataFrames in this iterable into a single DataFrame.

Link copied to clipboard
fun joinToString(separator: String = "/"): String
Link copied to clipboard
internal fun <T> List<T>.last(count: Int): List<T>
Link copied to clipboard
open override fun lastIndexOf(element: String): Int
Link copied to clipboard
Link copied to clipboard
open override fun listIterator(): ListIterator<String>
open override fun listIterator(index: Int): ListIterator<String>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
internal inline fun <C, reified R> ColumnReference<C>.map(infer: Infer = Infer.Nulls, noinline transform: (C) -> R): ColumnReference<R>
Link copied to clipboard

Returns a ColumnReference where each element is the result of subtracting value from the corresponding element of this ColumnReference.

Link copied to clipboard
open override fun name(): String
Link copied to clipboard
infix fun <C> ColumnReference<C>.neq(value: C): ColumnReference<Boolean>
Link copied to clipboard
@JvmName(name = "notBooleanNullable")
operator fun ColumnReference<Boolean?>.not(): ColumnReference<Boolean?>

Returns a ColumnReference containing the inverse Boolean values of this ColumnReference. Each null value in the original ColumnReference is preserved.

Returns a ColumnReference containing the inverse Boolean values of this ColumnReference.

Link copied to clipboard
inline fun <reified T> ColumnAccessor<T>.nullable(): ColumnAccessor<T?>
Link copied to clipboard
internal fun <A> ColumnAccessor<A>.onResolve(check: (ColumnWithPath<*>?) -> Unit): ColumnAccessor<A>

Helper function to perform runtime checks on a ColumnAccessor.

internal fun <A> SingleColumn<A>.onResolve(check: (ColumnWithPath<A>?) -> Unit): SingleColumn<A>

Helper function to perform runtime checks on a SingleColumn.

Link copied to clipboard
Link copied to clipboard
open override fun path(): ColumnPath
Link copied to clipboard
operator fun plus(name: String): ColumnPath
operator fun plus(otherPath: Iterable<String>): ColumnPath
operator fun plus(otherPath: ColumnPath): ColumnPath
Link copied to clipboard

Returns a ColumnReference of String values obtained by converting each element of this ColumnReference to a String and concatenating it with str.

operator fun ColumnReference<Int>.plus(value: Int): ColumnReference<Int>

Returns a ColumnReference where each element is the result of adding value to the corresponding element of this ColumnReference.

Link copied to clipboard
internal fun <T : Comparable<T>> List<T>.quickSelect(k: Int): T

Select the k't "smallest" element from list this

Link copied to clipboard
internal fun <T> List<T>.removeAt(index: Int): List<T>
Link copied to clipboard
open override fun rename(newName: String): ColumnPath
Link copied to clipboard
internal fun <C> SingleColumn<C>.renamedColumn(newName: String): SingleColumn<C>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun resolve(context: ColumnResolutionContext): List<ColumnWithPath<Any?>>

Resolves this ColumnsResolver as a List<ColumnWithPath<C>>. In many cases this function transforms a parent ColumnsResolver to reach the current ColumnsResolver result.

Link copied to clipboard
internal fun <C> ColumnsResolver<C>.resolve(df: DataFrame<*>, unresolvedColumnsPolicy: UnresolvedColumnsPolicy = UnresolvedColumnsPolicy.Fail): List<ColumnWithPath<C>>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
internal fun <C> SingleColumn<C>.resolveSingle(df: DataFrame<*>, unresolvedColumnsPolicy: UnresolvedColumnsPolicy = UnresolvedColumnsPolicy.Fail): ColumnWithPath<C>?
Link copied to clipboard
internal fun <T> Iterable<T>.rollingHash(): Int
Link copied to clipboard
internal fun <C, R> SingleColumn<DataRow<C>>.selectInternal(selector: ColumnsSelector<C, R>): ColumnSet<R>
Link copied to clipboard

Shorten column paths as much as possible to keep them unique

Link copied to clipboard
Link copied to clipboard

Simplifies structure by removing columns that are already present in column groups in this.

Link copied to clipboard

Simplifies structure by removing columns that are already present in column groups in this.

Link copied to clipboard

Converts this ColumnsResolver to a SingleColumn. resolveSingle will return the single column of this if there is only one, else it will throw an exception: In case of an empty ColumnsResolver, a NoSuchElementException will be thrown. In case of more than one column, an IllegalArgumentException will be thrown. If the result is used as a ColumnSet, null will be converted to an empty list.

Link copied to clipboard
internal fun <C> ColumnsResolver<C>.singleInternal(condition: ColumnFilter<C> = { true }): TransformableSingleColumn<C>
Link copied to clipboard

Converts this ColumnsResolver to a SingleColumn. resolveSingle will return the single column of this if there is only one, else it will return null. If the result used as a ColumnSet, null will be converted to an empty list.

Link copied to clipboard
internal fun <T> Iterable<KCallable<T>>.sortWithConstructor(klass: KClass<*>): List<KCallable<T>>

Sorts this according to the order of their columnName in the primary/single constructor of klass if it exists, else, it falls back to lexicographical sorting.

Link copied to clipboard
internal fun <T> List<T>.splitByIndices(startIndices: Sequence<Int>): Sequence<List<T>>
Link copied to clipboard
open override fun subList(fromIndex: Int, toIndex: Int): List<String>
Link copied to clipboard
fun take(first: Int): ColumnPath

Returns a shortened ColumnPath containing just the first first elements.

Link copied to clipboard
fun takeLast(last: Int): ColumnPath

Returns a shortened ColumnPath containing just the last last elements.

Link copied to clipboard

Returns a ColumnReference containing the results of multiplying each element of this ColumnReference by value.

Link copied to clipboard
inline fun <reified T> Iterable<T>.toColumn(property: KProperty<T>): DataColumn<T>
inline fun <reified T> Iterable<T>.toColumn(ref: ColumnReference<T>): DataColumn<T>
inline fun <reified T> Iterable<T>.toColumn(name: String = "", infer: Infer = Infer.Nulls): DataColumn<T>
Link copied to clipboard
Link copied to clipboard
inline fun <reified T> Iterable<*>.toColumnOf(name: String = ""): DataColumn<T>
Link copied to clipboard
@JvmName(name = "toColumnSetString")
fun Iterable<String>.toColumnSet(): ColumnSet<Any?>
@JvmName(name = "toColumnSetKProperty")
fun <C> Iterable<KProperty<C>>.toColumnSet(): ColumnSet<C>
@JvmName(name = "toColumnSetColumnPath")
fun Iterable<ColumnPath>.toColumnSet(): ColumnSet<Any?>
@JvmName(name = "toColumnSetColumnReference")
fun <C> Iterable<ColumnReference<C>>.toColumnSet(): ColumnSet<C>
@JvmName(name = "toColumnSetC")
fun <C> Iterable<ColumnsResolver<C>>.toColumnSet(): ColumnSet<C>
Link copied to clipboard
Link copied to clipboard
inline fun <reified T> Iterable<T>.toDataFrame(): DataFrame<T>
@JvmName(name = "toDataFrameMapStringAnyNullable")
fun Iterable<Map<String, Any?>>.toDataFrame(): DataFrame<*>
@JvmName(name = "toDataFrameT")
fun <T> Iterable<DataRow<T>>.toDataFrame(): DataFrame<T>
@JvmName(name = "toDataFrameAnyColumn")
fun Iterable<BaseColumn<*>>.toDataFrame(): DataFrame<*>
inline fun <reified T> Iterable<T>.toDataFrame(noinline body: CreateDataFrameDsl<T>.() -> Unit): DataFrame<T>
inline fun <reified T> Iterable<T>.toDataFrame(columnName: String): DataFrame<*>
inline fun <reified T> Iterable<T>.toDataFrame(vararg props: KProperty<*>, maxDepth: Int = 0): DataFrame<T>
fun <T> List<List<T>>.toDataFrame(containsColumns: Boolean = false): AnyFrame

fun <T> List<List<T>>.toDataFrame(header: List<String>?, containsColumns: Boolean = false): DataFrame<*>

Converts a list of lists into a DataFrame.

Link copied to clipboard
@JvmName(name = "toDataFrameColumnPathAnyNullable")
fun Iterable<Pair<ColumnPath, Iterable<Any?>>>.toDataFrameFromPairs(): DataFrame<*>
@JvmName(name = "toDataFramePairColumnPathAnyCol")
fun <T> Iterable<Pair<ColumnPath, BaseColumn<*>>>.toDataFrameFromPairs(): DataFrame<T>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
inline fun <reified T> Iterable<T>.toValueColumn(name: String = ""): ValueColumn<T>
inline fun <reified T> Iterable<T>.toValueColumn(column: KProperty<T>): ValueColumn<T>
inline fun <reified T> Iterable<T>.toValueColumn(column: ColumnAccessor<T>): ValueColumn<T>
Link copied to clipboard
internal inline fun <A, B> ColumnsResolver<A>.transform(crossinline converter: (List<ColumnWithPath<A>>) -> List<ColumnWithPath<B>>): TransformableColumnSet<B>

Applies a transformation on this by converting its List<ColumnWithPath<A>] to List<ColumnWithPath<B>] using converter.

Link copied to clipboard
internal fun <A, B> SingleColumn<A>.transformSingle(converter: (ColumnWithPath<A>) -> List<ColumnWithPath<B>>): ColumnSet<B>

Applies a transformation on this SingleColumn by converting its single ColumnWithPath<A> to List<ColumnWithPath<B>] using converter. Since converter allows you to return multiple columns, the result is turned into a ColumnSet<B>.

Link copied to clipboard

Applies a transformation on this SingleColumn by converting its single ColumnWithPath<A> to List<ColumnWithPath<B>] using converter but also providing the ColumnResolutionContext to the converter.

Link copied to clipboard

Applies a transformation on this by converting its List<ColumnWithPath<A>] to List<ColumnWithPath<B>] using converter, but also providing the ColumnResolutionContext to the converter.

Link copied to clipboard
internal fun Iterable<Any?>.types(): Set<KType>

Returns a set of KType objects representing the star-projected types of the runtime classes of all unique elements in the iterable.

Link copied to clipboard

Returns a ColumnReference containing negatives of the corresponding elements of this ColumnReference.

Link copied to clipboard
internal fun Iterable<KClass<*>>.unifiedNumberClassOrNull(options: UnifiedNumberTypeOptions = UnifiedNumberTypeOptions.DEFAULT): KClass<*>?

Determines the nearest common numeric type, in terms of complexity, all types in this.

Link copied to clipboard
internal fun Iterable<KType>.unifiedNumberTypeOrNull(options: UnifiedNumberTypeOptions = UnifiedNumberTypeOptions.DEFAULT): KType?

Determines the nearest common numeric type, in terms of complexity, all types in this.

Link copied to clipboard
Link copied to clipboard
internal inline fun ColumnsResolver<*>.valueColumnsInternal(crossinline filter: (ValueColumn<*>) -> Boolean): TransformableColumnSet<*>

Returns a TransformableColumnSet containing the value columns that satisfy the given filter.

Link copied to clipboard
internal fun Iterable<KClass<*>>.withMostSuperclasses(): KClass<*>?
Link copied to clipboard
inline fun <reified T> ColumnReference<T>.withValues(values: Iterable<T>): ValueColumn<T>
inline fun <reified T> ColumnReference<T>.withValues(vararg values: T): ValueColumn<T>