Class AbstractFormulaColumn
java.lang.Object
io.deephaven.engine.table.impl.select.AbstractFormulaColumn
- All Implemented Interfaces:
ConcurrencyControl<Selectable>,Selectable,FormulaColumn,SelectColumn
- Direct Known Subclasses:
DhFormulaColumn,FormulaColumnPython
A SelectColumn that implements a formula computed from the existing columns in the table and a query scope.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.engine.table.impl.select.SelectColumn
SelectColumn.ExpressionAdapter -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanstatic final Stringprotected Map<String,ColumnDefinition<?>> protected final @NotNull Stringprotected Map<String,? extends ColumnSource<?>> protected Future<FormulaFactory>protected Stringprotected final Stringprotected QueryScopeParam<?>[]protected Class<?>protected booleanprotected booleanprotected booleanFields inherited from interface io.deephaven.engine.table.impl.select.SelectColumn
ZERO_LENGTH_SELECT_COLUMN_ARRAY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractFormulaColumn(String columnName, String formulaString) Create a formula column for the given formula string. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyUsedVariables(@NotNull Map<String, ColumnDefinition<?>> parentColumnDefinitions, @NotNull Set<String> variablesUsed, @NotNull Map<String, Object> possibleParams) protected Future<FormulaFactory>createKernelFormulaFactory(@NotNull CompletionStageFuture<FormulaKernelFactory> formulaKernelFactoryFuture) Get a list of the names of column arrays used in this SelectColumn.Get a list of the names of columns used in this SelectColumn.@NotNull ColumnSource<?>Creates aColumnSourcethat will evaluate the result of theformulafor a given row on demand when it is accessed.@NotNull ColumnSource<?>Creates aColumnSourcethat will evaluate the result of theformulafor a given row on demand when it is accessed and cache the resultGet a MatchPair for this column, if applicable.getName()Get the name of the resultant column.Class<?>Get the data component type stored in the resultant column.Class<?>Get the data type stored in the resultant column.protected abstract FormulaSourceDescriptorbooleanReturns true if this column uses row virtual offset columns ofi,iiork.initInputs(@NotNull TrackingRowSet rowSet, @NotNull Map<String, ? extends ColumnSource<?>> columnsOfInterest) Initialize the column from the provided set of underlying columns and row set.booleanisRetain()newDestInstance(long size) Create a newWritableColumnSource.newFlatDestInstance(long size) Create a newimmutableWritableColumnSource.protected voidonCopy(AbstractFormulaColumn copy) toString()protected voidvalidateColumnDefinition(Map<String, ColumnDefinition<?>> columnDefinitionMap) voidvalidateSafeForRefresh(BaseTable<?> sourceTable) Validate that thisSelectColumnis safe to use in the context of the provided sourceTable.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.deephaven.engine.table.impl.select.FormulaColumn
getFormulaShiftedColumnDefinitions, getShiftedFormulaString, hasConstantArrayAccess, hasConstantValue, maybeGetFormulaColumnMethods inherited from interface io.deephaven.api.Selectable
declaredBarriers, isSerial, respectedBarriersMethods inherited from interface io.deephaven.engine.table.impl.select.SelectColumn
copy, expression, initDef, initDef, isStateless, maybeGetSourceColumn, newColumn, recomputeOnModifiedRow, withDeclaredBarriers, withRecomputeOnModifiedRow, withRespectedBarriers, withSerial
-
Field Details
-
ALLOW_UNSAFE_REFRESHING_FORMULAS
public static final boolean ALLOW_UNSAFE_REFRESHING_FORMULAS -
formulaString
-
originalFormulaString
-
usedColumns
-
columnName
-
formulaFactoryFuture
-
params
-
columnSources
-
columnDefinitions
-
returnedType
-
COLUMN_SUFFIX
- See Also:
-
usedColumnArrays
-
usesI
protected boolean usesI -
usesII
protected boolean usesII -
usesK
protected boolean usesK
-
-
Constructor Details
-
AbstractFormulaColumn
Create a formula column for the given formula string.The internal formula object is generated on-demand by calling out to the Java compiler.
- Parameters:
columnName- the result column nameformulaString- the formula string to be parsed by the QueryLanguageParser
-
-
Method Details
-
getReturnedType
Description copied from interface:SelectColumnGet the data type stored in the resultant column.- Specified by:
getReturnedTypein interfaceSelectColumn- Returns:
- the type
-
getReturnedComponentType
Description copied from interface:SelectColumnGet the data component type stored in the resultant column.- Specified by:
getReturnedComponentTypein interfaceSelectColumn- Returns:
- the component type
-
initInputs
public List<String> initInputs(@NotNull @NotNull TrackingRowSet rowSet, @NotNull @NotNull Map<String, ? extends ColumnSource<?>> columnsOfInterest) Description copied from interface:SelectColumnInitialize the column from the provided set of underlying columns and row set.- Specified by:
initInputsin interfaceSelectColumn- Parameters:
rowSet- the base row setcolumnsOfInterest- the input columns- Returns:
- a list of columns on which the result of this is dependent
-
validateSafeForRefresh
Description copied from interface:SelectColumnValidate that thisSelectColumnis safe to use in the context of the provided sourceTable.- Specified by:
validateSafeForRefreshin interfaceSelectColumn- Parameters:
sourceTable- the source table
-
applyUsedVariables
-
onCopy
-
validateColumnDefinition
-
getColumns
Description copied from interface:SelectColumnGet a list of the names of columns used in this SelectColumn. Behavior is undefined if none of the init* methods have been called yet.- Specified by:
getColumnsin interfaceSelectColumn- Returns:
- the columns used in this SelectColumn
-
getColumnArrays
Description copied from interface:SelectColumnGet a list of the names of column arrays used in this SelectColumn. Behavior is undefined if none of the init* methods have been called yet.- Specified by:
getColumnArraysin interfaceSelectColumn- Returns:
- the list of column arrays used
-
getDataView
Creates aColumnSourcethat will evaluate the result of theformulafor a given row on demand when it is accessed. The result of this is the column source produced by callingTableOperations.updateView(java.lang.String...)orTableOperations.view(java.lang.String...)on aTable.- Specified by:
getDataViewin interfaceSelectColumn- Returns:
- a
ColumnSource
-
getLazyView
Creates aColumnSourcethat will evaluate the result of theformulafor a given row on demand when it is accessed and cache the result- Specified by:
getLazyViewin interfaceSelectColumn- Returns:
- the column source produced by calling
TableOperations.lazyUpdate(java.lang.String...)on aTable.
-
createKernelFormulaFactory
protected Future<FormulaFactory> createKernelFormulaFactory(@NotNull @NotNull CompletionStageFuture<FormulaKernelFactory> formulaKernelFactoryFuture) -
getSourceDescriptor
-
getName
Description copied from interface:SelectColumnGet the name of the resultant column.- Specified by:
getNamein interfaceSelectColumn- Returns:
- the name of the column
-
getMatchPair
Description copied from interface:SelectColumnGet a MatchPair for this column, if applicable.- Specified by:
getMatchPairin interfaceSelectColumn- Returns:
- the MatchPair for this column, if applicable.
-
isRetain
public boolean isRetain()- Specified by:
isRetainin interfaceSelectColumn- Returns:
-
hasVirtualRowVariables
public boolean hasVirtualRowVariables()Description copied from interface:SelectColumnReturns true if this column uses row virtual offset columns ofi,iiork.- Specified by:
hasVirtualRowVariablesin interfaceSelectColumn
-
toString
-
newDestInstance
Description copied from interface:SelectColumnCreate a newWritableColumnSource. The returned column source must be capable of handling updates.- Specified by:
newDestInstancein interfaceSelectColumn- Parameters:
size- A hint as to the number of rows that will be used- Returns:
- a new
WritableColumnSource
-
newFlatDestInstance
Description copied from interface:SelectColumnCreate a newimmutableWritableColumnSource. The returned column source should be flat, and need not handle updates.- Specified by:
newFlatDestInstancein interfaceSelectColumn- Parameters:
size- A hint as to the number of rows that will be used- Returns:
- a new
WritableColumnSource
-