Class TupleState.MapColumnState
java.lang.Object
org.apache.drill.exec.physical.resultSet.impl.ColumnState
org.apache.drill.exec.physical.resultSet.impl.ColumnState.BaseContainerColumnState
org.apache.drill.exec.physical.resultSet.impl.TupleState.MapColumnState
- Enclosing class:
- TupleState
Represents a map column (either single or repeated). Includes maps that
 are top-level, nested within other maps, or nested inside a union.
 Schema management is a bit complex:
 
 
 
| Condition | Action | |
|---|---|---|
| Outside of Union | Inside of Union | |
| Unprojected | N/A | Omitted from output | 
| Added in prior batch | Included in output | |
| Added in present batch, before overflow | Included in output | |
| Added in present batch, after overflow | Omitted from output this batch (added next batch) | Included in output | 
The above rules say that, for maps in a union, the output schema is identical to the internal writer schema. But, for maps outside of union, the output schema is a subset of the internal schema with two types of omissions:
- Unprojected columns
- Columns added after overflow invalid input: '<'/ul
New columns can be added at any time for data readers that discover their schema as data is read (such as JSON). In this case, new columns always appear at the end of the map (remember, in Drill, a "map" is actually a structured: an ordered, named list of columns.) When looking for newly added columns, they will always be at the end.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.apache.drill.exec.physical.resultSet.impl.ColumnStateColumnState.BaseContainerColumnState, ColumnState.PrimitiveColumnState, ColumnState.State
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected booleanprotected final TupleState.MapStateprotected final ColumnMetadataFields inherited from class org.apache.drill.exec.physical.resultSet.impl.ColumnStateaddVersion, cardinality, loader, outputIndex, state, vectorState, writer
- 
Constructor SummaryConstructorsConstructorDescriptionMapColumnState(TupleState.MapState mapState, AbstractObjectWriter writer, VectorState vectorState, boolean isVersioned) 
- 
Method SummaryMethods inherited from class org.apache.drill.exec.physical.resultSet.impl.ColumnState.BaseContainerColumnStateclose, harvestWithLookAhead, rollover, startBatch, updateCardinalityMethods inherited from class org.apache.drill.exec.physical.resultSet.impl.ColumnStateallocateVectors, buildOutput, dump, innerCardinality, outerCardinality, schema, vector, vectorState, writer
- 
Field Details- 
mapState
- 
isVersionedprotected boolean isVersioned
- 
outputSchema
 
- 
- 
Constructor Details- 
MapColumnStatepublic MapColumnState(TupleState.MapState mapState, AbstractObjectWriter writer, VectorState vectorState, boolean isVersioned) 
 
- 
- 
Method Details- 
mapState
- 
container- Specified by:
- containerin class- ColumnState.BaseContainerColumnState
 
- 
isProjectedpublic boolean isProjected()- Overrides:
- isProjectedin class- ColumnState
 
- 
isVersionedpublic boolean isVersioned()Indicate if this map is versioned. A versionable map has three attributes:- Columns can be unprojected. (Columns appear as writers for the client of the result set loader, but are not materialized and do not appear in the projected output container.
- Columns appear in the output only if added before the overflow row.
- As a result, the output schema is a subset of the internal input schema.
 - Returns:
- true if this map is versioned as described above
 
- 
outputSchema- Specified by:
- outputSchemain class- ColumnState
 
 
-