Class RepeatedListState.RepeatedListVectorState
java.lang.Object
org.apache.drill.exec.physical.resultSet.impl.RepeatedListState.RepeatedListVectorState
- All Implemented Interfaces:
VectorState
- Enclosing class:
- RepeatedListState
Track the repeated list vector. The vector state holds onto the repeated
list vector, but only performs operations on the actual storage: the
offset vector. The child column state manages the repeated list content
(which may be complex: another repeated list, a map, a union, etc.)
-
Constructor Summary
ConstructorDescriptionRepeatedListVectorState
(AbstractObjectWriter arrayWriter, RepeatedListVector vector) -
Method Summary
Modifier and TypeMethodDescriptionint
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
A batch is being harvested after an overflow.boolean
Report whether this column is projected (has materialized vectors), or is unprojected (has no materialized backing.)void
rollover
(int cardinality) A vector has overflowed.void
A new batch is starting while an look-ahead vector exists.void
updateChildWriter
(AbstractObjectWriter childWriter) Bind the child writer once the child is created.vector()
Underlying vector: the one presented to the consumer of the result set loader.
-
Constructor Details
-
RepeatedListVectorState
-
-
Method Details
-
updateChildWriter
Bind the child writer once the child is created. Note: must pass in the child writer because it is not yet bound to the repeated list vector at the time of this call.- Parameters:
childWriter
- child array writer for the inner dimension of the repeated list
-
vector
Description copied from interface:VectorState
Underlying vector: the one presented to the consumer of the result set loader.- Specified by:
vector
in interfaceVectorState
-
allocate
public int allocate(int cardinality) Description copied from interface:VectorState
Allocate a new vector with the number of elements given. If the vector is an array, then the cardinality given is the number of arrays.- Specified by:
allocate
in interfaceVectorState
- Parameters:
cardinality
- number of elements desired in the allocated vector- Returns:
- the number of bytes allocated
-
rollover
public void rollover(int cardinality) Description copied from interface:VectorState
A vector has overflowed. Create a new look-ahead vector of the given cardinality, then copy the overflow values from the main vector to the look-ahead vector.- Specified by:
rollover
in interfaceVectorState
- Parameters:
cardinality
- the number of elements in the new vector. If this vector is an array, then this is the number of arrays
-
harvestWithLookAhead
public void harvestWithLookAhead()Description copied from interface:VectorState
A batch is being harvested after an overflow. Put the full batch back into the main vector so it can be harvested.- Specified by:
harvestWithLookAhead
in interfaceVectorState
-
startBatchWithLookAhead
public void startBatchWithLookAhead()Description copied from interface:VectorState
A new batch is starting while an look-ahead vector exists. Move the look-ahead buffers into the main vector to prepare for writing the rest of the batch.- Specified by:
startBatchWithLookAhead
in interfaceVectorState
-
close
public void close()Description copied from interface:VectorState
Clear the vector(s) associated with this state.- Specified by:
close
in interfaceVectorState
-
isProjected
public boolean isProjected()Description copied from interface:VectorState
Report whether this column is projected (has materialized vectors), or is unprojected (has no materialized backing.)- Specified by:
isProjected
in interfaceVectorState
- Returns:
- true if the column is projected to the output, false if not
-
dump
- Specified by:
dump
in interfaceVectorState
-