first

open fun <C> ColumnSet<C>.first(condition: (ColumnWithPath<C>) -> Boolean = { true }): SingleColumn<C>

First (Col)

Returns the first column from this that adheres to the optional given condition. If no column adheres to the given condition, NoSuchElementException is thrown.

This function operates solely on columns at the top-level.

NOTE: For column groups, first is named firstCol instead to avoid confusion.

For more information: See First (Col), Last (Col), Single (Col) on the documentation website.

Check out: Grammar

Examples:

df.select{ first{ it.name().startsWith("order") } }

df.select{ "myColumnGroup".firstCol{ it.name().startsWith("year") } }

Examples for this overload:

df.select{ colsOf<String>().first{ it.name().startsWith("year") } }

df.select{ colsOf<Int>().first() }

Return

A SingleColumn containing the first column that adheres to the given condition.

Parameters

condition

The optional ColumnFilter condition that the column must adhere to.

See also

Throws

if no column adheres to the given condition.


open fun ColumnsSelectionDsl<*>.first(condition: (ColumnWithPath<*>) -> Boolean = { true }): SingleColumn<*>

First (Col)

Returns the first column from this that adheres to the optional given condition. If no column adheres to the given condition, NoSuchElementException is thrown.

This function operates solely on columns at the top-level.

NOTE: For column groups, first is named firstCol instead to avoid confusion.

For more information: See First (Col), Last (Col), Single (Col) on the documentation website.

Check out: Grammar

Examples:

df.select{ first{ it.name().startsWith("order") } }

df.select{ "myColumnGroup".firstCol{ it.name().startsWith("year") } }

Examples for this overload:

df.select{ first{ it.name().startsWith("year") } }

Return

A SingleColumn containing the first column that adheres to the given condition.

Parameters

condition

The optional ColumnFilter condition that the column must adhere to.

See also

Throws

if no column adheres to the given condition.