single
Single (Col)
Returns the single column from this. If there is no column, NoSuchElementException is thrown. If there are multiple columns, IllegalArgumentException is thrown.
This function operates solely on columns at the top-level.
NOTE: For column groups, single is named singleCol instead to avoid confusion.
For more information: See First (Col), Last (Col), Single (Col) on the documentation website.
Check out: Grammar
Examples:
df.select{ nameStartsWith("order").single() }
df.select{ "myColumnGroup".colsNameStartsWith("order").singleCol() }
Examples for this overload:
df.select{ colsOf<String>().nameStartsWith("year").single() }
df.select{ colsOf<Int>().single() }
Return
A SingleColumn containing the single column.
Throws
Single (Col)
Returns the single column from this. If there is no column, NoSuchElementException is thrown. If there are multiple columns, IllegalArgumentException is thrown.
This function operates solely on columns at the top-level.
NOTE: For column groups, single is named singleCol instead to avoid confusion.
For more information: See First (Col), Last (Col), Single (Col) on the documentation website.
Check out: Grammar
Examples:
df.select{ nameStartsWith("order").single() }
df.select{ "myColumnGroup".colsNameStartsWith("order").singleCol() }
Examples for this overload:
df.select{ nameStartsWith("year").single() }
Return
A SingleColumn containing the single column.
Throws
Deprecated
Deprecated shortcut for better compiler plugin support. Will be ERROR in 1.1.
Replace with
this.filter(condition).single()Single (Col)
Returns the single column from this. If there is no column, NoSuchElementException is thrown. If there are multiple columns, IllegalArgumentException is thrown.
This function operates solely on columns at the top-level.
NOTE: For column groups, single is named singleCol instead to avoid confusion.
For more information: See First (Col), Last (Col), Single (Col) on the documentation website.
Check out: Grammar
Examples:
df.select{ nameStartsWith("order").single() }
df.select{ "myColumnGroup".colsNameStartsWith("order").singleCol() }
Examples for this overload:
df.select{ colsOf<String>().single{ it.name().startsWith("year") } }
df.select{ colsOf<Int>().single() }
Return
A SingleColumn containing the single column.
Throws
Deprecated
Deprecated shortcut for better compiler plugin support. Will be ERROR in 1.1.
Replace with
this.cols().filter(condition).single()Single (Col)
Returns the single column from this. If there is no column, NoSuchElementException is thrown. If there are multiple columns, IllegalArgumentException is thrown.
This function operates solely on columns at the top-level.
NOTE: For column groups, single is named singleCol instead to avoid confusion.
For more information: See First (Col), Last (Col), Single (Col) on the documentation website.
Check out: Grammar
Examples:
df.select{ nameStartsWith("order").single() }
df.select{ "myColumnGroup".colsNameStartsWith("order").singleCol() }
Examples for this overload:
df.select{ single{ it.name().startsWith("year") } }
Return
A SingleColumn containing the single column.