Tabular OperatorsProject Operators
serialize
Marks the row order of the input table as significant, optionally adding computed columns like extend.
Marks the row order of the input table as significant, optionally adding computed columns like extend. Required before window functions such as row_number that depend on serialized order.
Syntax
serialize [column = expression, ...]Serialize row order, optionally adding computed columns
Parameters
| Name | Description |
|---|---|
| column | Name for the new column |
| expression | Expression to compute the column value |
Examples
Example 1
datatable(ship:string, crew:long)[
"Naglfar", 80,
"Wave Rider", 45,
"Storm Bear", 60
]
| sort by crew desc
| serialize rank = row_number()| ship (string) | crew (long) | rank (long) |
|---|---|---|
| Naglfar | 80 | 1 |
| Storm Bear | 60 | 2 |
| Wave Rider | 45 | 3 |
Example 2
datatable(warrior:string, voyages:long)[
"Ragnar", 42,
"Bjorn", 31,
"Ivar", 35
]
| summarize count() by warrior
| serialize| warrior (string) | count_ (long) |
|---|---|
| Bjorn | 1 |
| Ivar | 1 |
| Ragnar | 1 |