Class UnionState
java.lang.Object
org.apache.drill.exec.physical.resultSet.impl.ContainerState
org.apache.drill.exec.physical.resultSet.impl.UnionState
- All Implemented Interfaces:
VariantWriter.VariantWriterListener
Represents the contents of a union vector (or a pseudo-union for lists).
Holds the column states for the "columns" that make up the type members
of the union, and implements the writer callbacks to add members to
a union. This class is used when a column is a (single, non-repeated)
UNION. See the
ListState
for when the union is used inside
a LIST (repeated union) type.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Union or list (repeated union) column state.static class
Vector wrapper for a union vector. -
Field Summary
Fields inherited from class org.apache.drill.exec.physical.resultSet.impl.ContainerState
loader, parentColumn, projectionSet, vectorCache
-
Constructor Summary
ConstructorDescriptionUnionState
(org.apache.drill.exec.physical.resultSet.impl.LoaderInternals events, ResultVectorCache vectorCache, ProjectionFilter projectionSet) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addColumn
(ColumnState colState) addMember
(ColumnMetadata member) addType
(TypeProtos.MinorType type) protected Collection<ColumnState>
int
protected boolean
Reports whether this container is subject to version management.vector()
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
-
UnionState
public UnionState(org.apache.drill.exec.physical.resultSet.impl.LoaderInternals events, ResultVectorCache vectorCache, ProjectionFilter projectionSet)
-
-
Method Details
-
writer
-
variantSchema
-
vector
-
addType
- Specified by:
addType
in interfaceVariantWriter.VariantWriterListener
-
addMember
- Specified by:
addMember
in interfaceVariantWriter.VariantWriterListener
-
addColumn
- Specified by:
addColumn
in classContainerState
-
columnStates
- Specified by:
columnStates
in classContainerState
-
innerCardinality
public int innerCardinality()- Specified by:
innerCardinality
in classContainerState
-
isVersioned
protected boolean isVersioned()Description copied from class:ContainerState
Reports whether this container is subject to version management. Version management adds columns to the output container at harvest time based on whether they should appear in the output batch.- Specified by:
isVersioned
in classContainerState
- Returns:
true
if versioned
-