public class UnionVectorShim extends Object implements UnionWriterImpl.UnionShim
WriterEvents.ColumnWriterListener, WriterEvents.State| Constructor and Description |
|---|
UnionVectorShim(org.apache.drill.exec.vector.complex.UnionVector vector) |
UnionVectorShim(org.apache.drill.exec.vector.complex.UnionVector vector,
AbstractObjectWriter[] variants) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMember(AbstractObjectWriter colWriter)
Add a column writer to an existing union writer.
|
AbstractObjectWriter |
addMember(ColumnMetadata schema) |
AbstractObjectWriter |
addMember(TypeProtos.MinorType type) |
void |
addMemberWriter(AbstractObjectWriter colWriter)
Performs just the work of adding a vector to the list of existing
variants.
|
void |
bindIndex(ColumnWriterIndex index)
Bind the writer to a writer index.
|
void |
bindListener(WriterEvents.ColumnWriterListener listener)
Bind a listener to the underlying vector writer.
|
void |
bindWriter(UnionWriterImpl writer) |
void |
dump(HierarchicalFormatter format) |
void |
endArrayValue()
End a value.
|
void |
endWrite()
End a batch: finalize any vector values.
|
boolean |
hasType(TypeProtos.MinorType type) |
void |
initTypeIndex(int typeFillCount)
When promoting the list to a union, the union's
type vector was initialized for any rows written thus
far.
|
int |
lastWriteIndex()
Return the last write position in the vector.
|
ObjectWriter |
member(TypeProtos.MinorType type)
Return an existing writer for the given type, or create a new one
if needed.
|
void |
postRollover()
The vectors backing this writer rolled over.
|
void |
preRollover()
The vectors backing this vector are about to roll over.
|
void |
restartRow()
During a writer to a row, rewind the the current index position to
restart the row.
|
int |
rowStartIndex()
Position within the vector of the first value for the current row.
|
void |
saveRow()
Saves a row.
|
void |
setNull() |
void |
setType(TypeProtos.MinorType type) |
void |
startRow()
Start a new row.
|
void |
startWrite()
Start a write (batch) operation.
|
AbstractScalarWriterImpl |
typeWriter()
Return the writer for the types vector.
|
int |
writeIndex()
Current write index for the writer.
|
public UnionVectorShim(org.apache.drill.exec.vector.complex.UnionVector vector)
public UnionVectorShim(org.apache.drill.exec.vector.complex.UnionVector vector,
AbstractObjectWriter[] variants)
public void bindWriter(UnionWriterImpl writer)
bindWriter in interface UnionWriterImpl.UnionShimpublic void bindIndex(ColumnWriterIndex index)
WriterEventsbindIndex in interface WriterEventsindex - the writer index (top level or nested for
arrays)public void bindListener(WriterEvents.ColumnWriterListener listener)
WriterEventsbindListener in interface WriterEventslistener - the vector event listener to bindpublic void setNull()
setNull in interface UnionWriterImpl.UnionShimpublic boolean hasType(TypeProtos.MinorType type)
hasType in interface UnionWriterImpl.UnionShimpublic ObjectWriter member(TypeProtos.MinorType type)
UnionWriterImpl.UnionShimmember in interface UnionWriterImpl.UnionShimtype - desired variant typepublic void setType(TypeProtos.MinorType type)
setType in interface UnionWriterImpl.UnionShimpublic AbstractObjectWriter addMember(ColumnMetadata schema)
addMember in interface UnionWriterImpl.UnionShimpublic AbstractObjectWriter addMember(TypeProtos.MinorType type)
addMember in interface UnionWriterImpl.UnionShimpublic void addMember(AbstractObjectWriter colWriter)
addMember in interface UnionWriterImpl.UnionShimcolWriter - the column writer to addpublic void addMemberWriter(AbstractObjectWriter colWriter)
addMember() and repeat those operations.colWriter - the column (type) writer to addpublic void startWrite()
WriterEventsstartWrite in interface WriterEventspublic void startRow()
WriterEventsWriterEvents.restartRow() instead.startRow in interface WriterEventspublic void endArrayValue()
WriterEventsWriterEvents.saveRow(), but the save of a value
is conditional on saving the row. This version is primarily of use
in tuples nested inside arrays: it saves each tuple within the array,
advancing to a new position in the array. The update of the array's
offset vector based on the cumulative value saves is done when
saving the row.endArrayValue in interface WriterEventspublic void restartRow()
WriterEventsrestartRow in interface WriterEventspublic void saveRow()
WriterEventssaveRow in interface WriterEventspublic void preRollover()
WriterEventspreRollover in interface WriterEventspublic void postRollover()
WriterEventspostRollover in interface WriterEventspublic void endWrite()
WriterEventsendWrite in interface WriterEventspublic AbstractScalarWriterImpl typeWriter()
public int writeIndex()
WriterPositionwriteIndex in interface WriterPositionpublic int lastWriteIndex()
WriterPositionlastWriteIndex in interface UnionWriterImpl.UnionShimlastWriteIndex in interface WriterPositionpublic int rowStartIndex()
WriterPositionrowStartIndex in interface UnionWriterImpl.UnionShimrowStartIndex in interface WriterPositionpublic void initTypeIndex(int typeFillCount)
public void dump(HierarchicalFormatter format)
dump in interface WriterEventsCopyright © 2021 The Apache Software Foundation. All rights reserved.