Class ColumnsArrayManager
- All Implemented Interfaces:
ReaderLevelProjection.ReaderProjectionResolver
- `columns`: Use the columns array.
- Wildcard: Equivalent to columns.
- One or more references to specific array members: columns[2], columns[4], ....
The columns mechanism works in conjunction with a reader that is aware of this model. For example, the text reader can be configured to use the columns mechanism, or to pick out columns by name. The reader and this mechanism must be coordinated: configure this mechanism only when the reader itself is configured to use model. That configuration is done outside of this mechanism; it is typically done when setting up the scan operator.
The output of this mechanism is a specialized projected column that identifies itself as the columns column, and optionally holds the list of selected elements.
Configuration
The mechanism handles two use cases:- The reader uses normal named columns. In this case the scan operator should not configure this mechanism; that will allow a column called columns to work like any other column: no special handling.
- The reader uses a single columns array as described below.
ScanSchemaOrchestrator
. The associated parser handles the scan-level
projection resolution.
The reader produces a schema with a single column, columns, of the agreed-upon type (as configured here.)
Although the ResultSetLoader
automatically handles column-level
projection; it does not handle array-level projection. (Perhaps we might want
to add that later.) Instead, the reader is given a pointer to this mechanism
from which it can retrieve the desired set of array items, and writes only those
items to the array column via the usual vector writer mechanism.
-
Constructor Summary
ConstructorDescriptionColumnsArrayManager
(boolean requireColumnsArray) ColumnsArrayManager
(boolean requireColumnsArray, boolean allowOtherCols) -
Method Summary
Modifier and TypeMethodDescriptionboolean[]
boolean
boolean
resolveColumn
(ColumnProjection col, ResolvedTuple outputTuple, TupleMetadata tableSchema) resolver()
void
-
Constructor Details
-
ColumnsArrayManager
public ColumnsArrayManager(boolean requireColumnsArray, boolean allowOtherCols) -
ColumnsArrayManager
public ColumnsArrayManager(boolean requireColumnsArray)
-
-
Method Details
-
projectionParser
-
resolver
-
startResolution
public void startResolution()- Specified by:
startResolution
in interfaceReaderLevelProjection.ReaderProjectionResolver
-
resolveColumn
public boolean resolveColumn(ColumnProjection col, ResolvedTuple outputTuple, TupleMetadata tableSchema) - Specified by:
resolveColumn
in interfaceReaderLevelProjection.ReaderProjectionResolver
-
elementProjection
public boolean[] elementProjection() -
hasColumnsArrayColumn
public boolean hasColumnsArrayColumn()
-