Class ReinterpretedColumn<S,D>
java.lang.Object
io.deephaven.engine.table.impl.select.ReinterpretedColumn<S,D>
- All Implemented Interfaces:
ConcurrencyControl<Selectable>
,Selectable
,SelectColumn
Allows
ColumnSource
reinterpretation via view-type (TableOperations.view(java.lang.String...)
and TableOperations.updateView(java.lang.String...)
)
Table
operations.
TODO: If we come up with other valid, useful reinterpretations, it would be trivial to create a general purpose syntax for use in view()/updateView() column expressions.
The syntax I have in mind is: "<ColumnNameB>=<ColumnNameA>.as(<ClassName>)" "<ColumnName>.as(<ClassName>)"
Making this work would consist of any one of: 1. Adding a V1 version and updating SelectColumnFactory and SelectColumnAdaptor 2. Adding the appropriate if-regex-matches to realColumn selection in V2 SwitchColumn 3. Creating a V2-native SelectColumnFactory
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.engine.table.impl.select.SelectColumn
SelectColumn.ExpressionAdapter
-
Field Summary
Fields inherited from interface io.deephaven.engine.table.impl.select.SelectColumn
ZERO_LENGTH_SELECT_COLUMN_ARRAY
-
Constructor Summary
ConstructorsConstructorDescriptionReinterpretedColumn
(@NotNull String sourceName, @NotNull Class<S> sourceDataType, @NotNull String destName, @NotNull Class<D> destDataType, Object... reinterpParams) Create aReinterpretedColumn
that attempts to convert the source column into the destination type, optionally with parameters. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Create a copy of this SelectColumn.boolean
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<D>
Get aColumnSource
that can be used to access the data on demand.@NotNull ColumnSource<D>
Returns a lazily computed view of this column.Get 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.int
hashCode()
initDef
(@NotNull Map<String, ColumnDefinition<?>> columnDefinitionMap) Initialize any internal column definitions from the provided initial.initInputs
(TrackingRowSet rowSet, Map<String, ? extends ColumnSource<?>> columnsOfInterest) Initialize the column from the provided set of underlying columns and row set.boolean
isRetain()
boolean
Returns true if this column is stateless (i.e.newDestInstance
(long size) Create a newWritableColumnSource
.newFlatDestInstance
(long size) Create a newimmutable
WritableColumnSource
.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.deephaven.api.Selectable
declaredBarriers, isSerial, respectedBarriers
Methods inherited from interface io.deephaven.engine.table.impl.select.SelectColumn
expression, hasConstantArrayAccess, hasConstantValue, hasVirtualRowVariables, initDef, maybeGetFormulaColumn, maybeGetSourceColumn, newColumn, recomputeOnModifiedRow, validateSafeForRefresh, withDeclaredBarriers, withRecomputeOnModifiedRow, withRespectedBarriers, withSerial
-
Constructor Details
-
ReinterpretedColumn
public ReinterpretedColumn(@NotNull @NotNull String sourceName, @NotNull @NotNull Class<S> sourceDataType, @NotNull @NotNull String destName, @NotNull @NotNull Class<D> destDataType, Object... reinterpParams) Create aReinterpretedColumn
that attempts to convert the source column into the destination type, optionally with parameters.- Parameters:
sourceName
- the name of the Source column within the tablesourceDataType
- the type of the source columndestName
- the name of the desired destination columndestDataType
- the type to try to convert toreinterpParams
- a varargs set of parameters for the arguments if required.
-
-
Method Details
-
toString
-
initInputs
public List<String> initInputs(TrackingRowSet rowSet, Map<String, ? extends ColumnSource<?>> columnsOfInterest) Description copied from interface:SelectColumn
Initialize the column from the provided set of underlying columns and row set.- Specified by:
initInputs
in interfaceSelectColumn
- Parameters:
rowSet
- the base row setcolumnsOfInterest
- the input columns- Returns:
- a list of columns on which the result of this is dependent
-
initDef
Description copied from interface:SelectColumn
Initialize any internal column definitions from the provided initial. Any formulae will be compiled immediately using theQueryCompiler
in the currentExecutionContext
.- Specified by:
initDef
in interfaceSelectColumn
- Parameters:
columnDefinitionMap
- the starting set of column definitions; valid for this call only- Returns:
- a list of columns on which the result of this is dependent
-
getReturnedType
Description copied from interface:SelectColumn
Get the data type stored in the resultant column.- Specified by:
getReturnedType
in interfaceSelectColumn
- Returns:
- the type
-
getReturnedComponentType
Description copied from interface:SelectColumn
Get the data component type stored in the resultant column.- Specified by:
getReturnedComponentType
in interfaceSelectColumn
- Returns:
- the component type
-
getColumns
Description copied from interface:SelectColumn
Get 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:
getColumns
in interfaceSelectColumn
- Returns:
- the columns used in this SelectColumn
-
getColumnArrays
Description copied from interface:SelectColumn
Get 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:
getColumnArrays
in interfaceSelectColumn
- Returns:
- the list of column arrays used
-
getDataView
Description copied from interface:SelectColumn
Get aColumnSource
that can be used to access the data on demand.- Specified by:
getDataView
in interfaceSelectColumn
- Returns:
- a
ColumnSource
-
getLazyView
Description copied from interface:SelectColumn
Returns a lazily computed view of this column.- Specified by:
getLazyView
in interfaceSelectColumn
- Returns:
- a lazily computed column source
-
getName
Description copied from interface:SelectColumn
Get the name of the resultant column.- Specified by:
getName
in interfaceSelectColumn
- Returns:
- the name of the column
-
getMatchPair
Description copied from interface:SelectColumn
Get a MatchPair for this column, if applicable.- Specified by:
getMatchPair
in interfaceSelectColumn
- Returns:
- the MatchPair for this column, if applicable.
-
newDestInstance
Description copied from interface:SelectColumn
Create a newWritableColumnSource
. The returned column source must be capable of handling updates.- Specified by:
newDestInstance
in interfaceSelectColumn
- Parameters:
size
- A hint as to the number of rows that will be used- Returns:
- a new
WritableColumnSource
-
newFlatDestInstance
Description copied from interface:SelectColumn
Create a newimmutable
WritableColumnSource
. The returned column source should be flat, and need not handle updates.- Specified by:
newFlatDestInstance
in interfaceSelectColumn
- Parameters:
size
- A hint as to the number of rows that will be used- Returns:
- a new
WritableColumnSource
-
isRetain
public boolean isRetain()- Specified by:
isRetain
in interfaceSelectColumn
- Returns:
-
equals
-
hashCode
public int hashCode() -
isStateless
public boolean isStateless()Description copied from interface:SelectColumn
Returns true if this column is stateless (i.e. one row does not depend on the order of evaluation for another row).- Specified by:
isStateless
in interfaceSelectColumn
-
copy
Description copied from interface:SelectColumn
Create a copy of this SelectColumn.- Specified by:
copy
in interfaceSelectColumn
- Returns:
- an independent copy of this SelectColumn.
-