public abstract class SingleVectorState extends Object implements VectorState
Modifier and Type | Class and Description |
---|---|
static class |
SingleVectorState.FixedWidthVectorState
State for a scalar value vector.
|
static class |
SingleVectorState.IsSetVectorState |
static class |
SingleVectorState.OffsetVectorState
Special case for an offset vector.
|
static class |
SingleVectorState.SimpleVectorState |
static class |
SingleVectorState.VariableWidthVectorState
State for a scalar value vector.
|
Modifier and Type | Field and Description |
---|---|
protected ValueVector |
backupVector |
protected ValueVector |
mainVector |
protected WriterEvents |
writer |
Constructor and Description |
---|
SingleVectorState(WriterEvents writer,
ValueVector mainVector) |
Modifier and Type | Method and Description |
---|---|
int |
allocate(int cardinality)
Allocate a new vector with the number of elements given.
|
protected abstract int |
allocateVector(ValueVector vector,
int cardinality) |
void |
close()
Clear the vector(s) associated with this state.
|
protected abstract void |
copyOverflow(int sourceStartIndex,
int sourceEndIndex) |
void |
dump(HierarchicalFormatter format) |
void |
harvestWithLookAhead()
Exchange the data from the backup vector and the main vector, putting
the completed buffers back into the main vectors, and stashing the
overflow buffers away in the backup vector.
|
boolean |
isProjected()
Report whether this column is projected (has materialized vectors),
or is unprojected (has no materialized backing.)
|
protected static TypeProtos.MajorType |
parseVectorType(ValueVector vector)
The vector mechanism here relies on the vector metadata.
|
void |
rollover(int cardinality)
A column within the row batch overflowed.
|
void |
startBatchWithLookAhead()
The previous full batch has been sent downstream and the client is
now ready to start writing to the next batch.
|
<T extends ValueVector> |
vector()
Underlying vector: the one presented to the consumer of the
result set loader.
|
static SingleVectorState.SimpleVectorState |
vectorState(ColumnMetadata schema,
WriterEvents writer,
ValueVector mainVector) |
protected final WriterEvents writer
protected final ValueVector mainVector
protected ValueVector backupVector
public SingleVectorState(WriterEvents writer, ValueVector mainVector)
public <T extends ValueVector> T vector()
VectorState
vector
in interface VectorState
public int allocate(int cardinality)
VectorState
allocate
in interface VectorState
cardinality
- number of elements desired in the allocated
vectorprotected abstract int allocateVector(ValueVector vector, int cardinality)
public void rollover(int cardinality)
rollover
in interface VectorState
cardinality
- the number of unique columns in the rowprotected static TypeProtos.MajorType parseVectorType(ValueVector vector)
values
vector which
is required. But the values
vector will carry metadata that
declares it to be nullable. While this is clearly a bug, it is a bug that has
become a "feature" and cannot be changed. This code works around this feature
by parsing out the actual type of the vector.vector
- the vector to clone, the type of which may not match the
metadata declared within that vectorprotected abstract void copyOverflow(int sourceStartIndex, int sourceEndIndex)
public void harvestWithLookAhead()
harvestWithLookAhead
in interface VectorState
public void startBatchWithLookAhead()
startBatchWithLookAhead
in interface VectorState
public void close()
VectorState
close
in interface VectorState
public boolean isProjected()
VectorState
isProjected
in interface VectorState
public static SingleVectorState.SimpleVectorState vectorState(ColumnMetadata schema, WriterEvents writer, ValueVector mainVector)
public void dump(HierarchicalFormatter format)
dump
in interface VectorState
Copyright © 1970 The Apache Software Foundation. All rights reserved.