Class RollingFormulaDefinitions
java.lang.Object
io.deephaven.engine.table.impl.updateby.RollingFormulaDefinitions
The formulas that
rolling formula operators compile, and the column definitions they
compile them against.
Callers that validate a rolling formula before passing it to the engine use these methods to inspect exactly the columns that the engine compiles.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the single input column of a rolling formula with aparam token. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull SelectColumnmakeMultiColumnFormulaColumn(@NotNull String formula) Make the select column for a rolling formula without aparam token.static @NotNull FormulaColumnmakeParamFormulaColumn(@NotNull String outputColumnName, @NotNull String formula, @NotNull String paramToken) Make the formula column for a rolling formula with aparam token, whose formula isreplaceParamToken(String, String).static @NotNull Map<String, ColumnDefinition<?>> multiColumnFormulaInputDefinitions(@NotNull TableDefinition tableDef, @NotNull Set<String> groupByColumnNames) The column definitions that a rolling formula without aparam tokenis compiled against: each group-by column as its own scalar definition, and every other source column as a vector of its type.static @NotNull Map<String, ColumnDefinition<?>> paramFormulaInputDefinitions(@NotNull Class<?> inputColumnType) The column definitions that a rolling formula with aparam tokenis compiled against: onlyPARAM_COLUMN_NAME, as a vector of the input column's type.static @NotNull MatchPair[]paramFormulaInputs(@NotNull TableDefinition tableDef, @NotNull RollingFormulaSpec spec, @NotNull MatchPair[] columns, @NotNull MatchPair[] groupByColumns) Select the input columns of a rolling formula with aparam token.static @NotNull StringreplaceParamToken(@NotNull String formula, @NotNull String paramToken)
-
Field Details
-
PARAM_COLUMN_NAME
The name of the single input column of a rolling formula with aparam token. The param token in the formula is replaced with this name.- See Also:
-
-
Method Details
-
paramFormulaInputs
@NotNull public static @NotNull MatchPair[] paramFormulaInputs(@NotNull @NotNull TableDefinition tableDef, @NotNull @NotNull RollingFormulaSpec spec, @NotNull @NotNull MatchPair[] columns, @NotNull @NotNull MatchPair[] groupByColumns) Select the input columns of a rolling formula with aparam token. Whencolumnsis empty, every source column that is not a group-by column is an input. The timestamp column of a time-based window is never an input.- Parameters:
tableDef- the definition of the source tablespec- the rolling formula speccolumns- the output/input pairs of the operation, possibly emptygroupByColumns- the group-by columns of the update by- Returns:
- the output/input pairs for which the engine creates an operator
-
replaceParamToken
@NotNull public static @NotNull String replaceParamToken(@NotNull @NotNull String formula, @NotNull @NotNull String paramToken) - Parameters:
formula- the formulaparamToken- the param token- Returns:
- the formula that the engine compiles
-
makeParamFormulaColumn
@NotNull public static @NotNull FormulaColumn makeParamFormulaColumn(@NotNull @NotNull String outputColumnName, @NotNull @NotNull String formula, @NotNull @NotNull String paramToken) Make the formula column for a rolling formula with aparam token, whose formula isreplaceParamToken(String, String). The result is not initialized; the engine initializes it againstparamFormulaInputDefinitions(Class).- Parameters:
outputColumnName- the name of the output columnformula- the formulaparamToken- the param token- Returns:
- an uninitialized formula column
-
paramFormulaInputDefinitions
@NotNull public static @NotNull Map<String,ColumnDefinition<?>> paramFormulaInputDefinitions(@NotNull @NotNull Class<?> inputColumnType) The column definitions that a rolling formula with aparam tokenis compiled against: onlyPARAM_COLUMN_NAME, as a vector of the input column's type.- Parameters:
inputColumnType- the data type of the input column- Returns:
- a map from
PARAM_COLUMN_NAMEto its vector column definition
-
makeMultiColumnFormulaColumn
@NotNull public static @NotNull SelectColumn makeMultiColumnFormulaColumn(@NotNull @NotNull String formula) Make the select column for a rolling formula without aparam token. The result is not initialized; the engine initializes it againstmultiColumnFormulaInputDefinitions(TableDefinition, Set).- Parameters:
formula- the formula, an assignment to the output column- Returns:
- an uninitialized select column
-
multiColumnFormulaInputDefinitions
@NotNull public static @NotNull Map<String,ColumnDefinition<?>> multiColumnFormulaInputDefinitions(@NotNull @NotNull TableDefinition tableDef, @NotNull @NotNull Set<String> groupByColumnNames) The column definitions that a rolling formula without aparam tokenis compiled against: each group-by column as its own scalar definition, and every other source column as a vector of its type.- Parameters:
tableDef- the definition of the source tablegroupByColumnNames- the names of the group-by columns- Returns:
- a map from column name to definition, in the order of
tableDef
-