col
: reference to a column.
col : (<str> | <var>) -> <expr>
select col first_name
exclude
: remove columns from the data frame.
exclude : <expr>* -> <expr>
select exclude last_name first_name
- literal: literal values like
42
, "John"
, 1.0
, and null
.
- binary operations
select a * b
- Calculate the product of columns "a" and "b" and collect the result.
- unary operations
select -a
- aggregate
<aggregate> : <expr>? -> <expr>
select sum a
- Sum all values in column "a" and collect the scalar result.
alias
: assign a name to a column.
alias : (<col> | <var>) <expr> -> <expr>
select alias product a * b
- Assign the name "product" to the product and collect the new column.
- conditional
<conditional> : if <expr> then <expr> (if <expr> then <expr>)* otherwise <expr> -> <expr>
select if class = 0 then "A" if class = 1 then "B" else null
cast
: cast a column to either type str
, int
, or float
.
cast : <type> <expr> -> <expr>
select cast str id
- Cast the column "id" to type
str
and collect the result.