Class TupleState.MapState
java.lang.Object
org.apache.drill.exec.physical.resultSet.impl.ContainerState
org.apache.drill.exec.physical.resultSet.impl.TupleState
org.apache.drill.exec.physical.resultSet.impl.TupleState.MapState
- All Implemented Interfaces:
AbstractTupleWriter.TupleWriterListener
- Direct Known Subclasses:
TupleState.DictState
,TupleState.MapArrayState
,TupleState.SingleMapState
- Enclosing class:
- TupleState
Represents a tuple defined as a Drill map: single or repeated. Note that
the map vector does not exist here; it is assembled only when "harvesting"
a batch. This design supports the obscure case in which a new column
is added during an overflow row, so exists within this abstraction,
but is not published to the map that makes up the output.
The map state is associated with a map vector. This vector is built either during harvest time (normal maps) or on the fly (union maps.)
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.drill.exec.physical.resultSet.impl.TupleState
TupleState.DictArrayState, TupleState.DictArrayVectorState, TupleState.DictColumnState, TupleState.DictState, TupleState.DictVectorState<T extends ValueVector>, TupleState.MapArrayState, TupleState.MapColumnState, TupleState.MapState, TupleState.MapVectorState, TupleState.RowState, TupleState.SingleDictState, TupleState.SingleDictVectorState, TupleState.SingleMapState
-
Field Summary
Fields inherited from class org.apache.drill.exec.physical.resultSet.impl.TupleState
columns, outputSchema, schema
Fields inherited from class org.apache.drill.exec.physical.resultSet.impl.ContainerState
loader, parentColumn, projectionSet, vectorCache
-
Constructor Summary
ConstructorDescriptionMapState
(org.apache.drill.exec.physical.resultSet.impl.LoaderInternals events, ResultVectorCache vectorCache, ProjectionFilter projectionSet) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addColumn
(ColumnState colState) int
addOutputColumn
(ValueVector vector, ColumnMetadata colSchema) void
bindColumnState
(TupleState.MapColumnState colState) void
dump
(HierarchicalFormatter format) int
protected boolean
A map is within a union if the map vector has been materialized.Methods inherited from class org.apache.drill.exec.physical.resultSet.impl.TupleState
addColumn, addColumn, bindOutputSchema, columns, columnStates, hasProjections, isProjected, outputSchema, schema, updateOutput, writer
Methods inherited from class org.apache.drill.exec.physical.resultSet.impl.ContainerState
addColumn, bindColumnState, close, harvestWithLookAhead, loader, projection, rollover, startBatch, updateCardinality, vectorCache
-
Constructor Details
-
MapState
public MapState(org.apache.drill.exec.physical.resultSet.impl.LoaderInternals events, ResultVectorCache vectorCache, ProjectionFilter projectionSet)
-
-
Method Details
-
bindColumnState
-
addOutputColumn
- Specified by:
addOutputColumn
in classTupleState
-
addColumn
- Overrides:
addColumn
in classTupleState
-
isVersioned
protected boolean isVersioned()A map is within a union if the map vector has been materialized. Top-level maps are built at harvest time. But, due to the complexity of unions, maps within unions are materialized. This method ensures that maps are materialized regardless of nesting depth within a union.- Specified by:
isVersioned
in classContainerState
- Returns:
true
if versioned
-
innerCardinality
public int innerCardinality()- Specified by:
innerCardinality
in classContainerState
-
dump
- Overrides:
dump
in classTupleState
-