Built-in query language variables
There are three special built-in query language variables worth noting. They correspond to row indices in tables.
i
is a 32-bit integer representing the current row index.ii
is a 64-bit integer representing the current row index.k
is a 64-bit integer representing a special internal indexing value.
i
and ii
can be used to access the current, previous, and subsequent rows in a table.
Warning
k
is a Deephaven engine index and does not correspond to traditional row indices. It is used for Deephaven engine development and should only be used in limited circumstances, such as debugging or advanced query operations.
Warning
These built-in variables are not reliable in ticking tables. They should only be used in static cases.
Usage
The following code block shows how to use i
and ii
in a query:
from deephaven import empty_table
source = empty_table(10).update(
["RowIndex32Bit = i", "RowIndex64Bit = ii", "EngineIndex64Bit = k"]
)