public class RepeatedVectorState extends Object implements VectorState
| Constructor and Description |
|---|
RepeatedVectorState(ArrayWriter writer,
RepeatedValueVector vector) |
| Modifier and Type | Method and Description |
|---|---|
int |
allocate(int cardinality)
Allocate a new vector with the number of elements given.
|
void |
close()
Clear the vector(s) associated with this state.
|
void |
dump(HierarchicalFormatter format) |
void |
harvestWithLookAhead()
A batch is being harvested after an overflow.
|
boolean |
isProjected()
Report whether this column is projected (has materialized vectors),
or is unprojected (has no materialized backing.)
|
void |
rollover(int newCardinality)
The column is a scalar or an array of scalars.
|
void |
startBatchWithLookAhead()
A new batch is starting while an look-ahead vector exists.
|
<T extends ValueVector> |
vector()
Underlying vector: the one presented to the consumer of the
result set loader.
|
public RepeatedVectorState(ArrayWriter writer, RepeatedValueVector vector)
public <T extends ValueVector> T vector()
VectorStatevector in interface VectorStatepublic int allocate(int cardinality)
VectorStateallocate in interface VectorStatecardinality - number of elements desired in the allocated
vectorpublic void rollover(int newCardinality)
Data structure:
RepeatedVectorState (this class) +- OffsetVectorState . +- OffsetVectorWriter (A) . +- Offset vector (B) . +- Backup (e.g. look-ahead) offset vector +- ValuesVectorState . +- Scalar (element) writer (C) . +- Data (elements) vector (D) . +- Backup elements vector +- Array Writer . +- ColumnWriterIndex (for array as a whole) . +- OffsetVectorWriter (A) . . +- Offset vector (B) . +- ArrayElementWriterIndex . +- ScalarWriter (D) . . +- ArrayElementWriterIndex . . +- Scalar vector (D)
The top group of objects point into the writer objects in the second group. Letters in parens show the connections.
To perform the roll-over, we must:
rollover in interface VectorStatenewCardinality - the number of outer elements to create in the look-ahead
vectorpublic void harvestWithLookAhead()
VectorStateharvestWithLookAhead in interface VectorStatepublic void startBatchWithLookAhead()
VectorStatestartBatchWithLookAhead in interface VectorStatepublic void close()
VectorStateclose in interface VectorStatepublic boolean isProjected()
VectorStateisProjected in interface VectorStatepublic void dump(HierarchicalFormatter format)
dump in interface VectorStateCopyright © 2021 The Apache Software Foundation. All rights reserved.