Berserk Docs
Tabular OperatorsProject Operators

serialize

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

NameDescription
columnName for the new column
expressionExpression 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)
Naglfar801
Storm Bear602
Wave Rider453

Example 2

datatable(warrior:string, voyages:long)[
  "Ragnar", 42,
  "Bjorn", 31,
  "Ivar", 35
]
| summarize count() by warrior
| serialize
warrior (string)count_ (long)
Bjorn1
Ivar1
Ragnar1

On this page