Project
project
Selects a subset of columns from the input, optionally renaming or computing new columns. The output schema contains only the specified columns in the listed order.
Spec
... | project <column_expression> [, ...] Parameters
column_expression - A column name, or an expression in the form <name> = <expression>. Return Value
A table with only the listed columns. Column order matches the project list. Example
datatable(Name:string, Age:int64, City:string)
[
"Alice", 30, "Seattle",
"Bob", 25, "Portland"
]
| project Name, Age | Name | Age |
|---|---|
| Alice | 30 |
| Bob | 25 |
Rename and compute columns:
range val from 1 to 3 step 1
| project doubled = val * 2 | doubled |
|---|
| 2 |
| 4 |
| 6 |