Interface UnionShim
- All Superinterfaces:
WriterEvents,WriterPosition
- All Known Implementing Classes:
EmptyListShim,SimpleListShim,UnionShim.AbstractUnionShim,UnionVectorShim
Unions are overly complex. They can evolve from no type, to a single type,
to multiple types. The kind of vector used in these cases differ. This
shim acts as a facade between the writer and the underlying vector, allowing
the writer to remain constant while the vector (and its shim) evolves.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.apache.drill.exec.vector.accessor.writer.WriterEvents
WriterEvents.ColumnWriterListener, WriterEvents.State -
Method Summary
Modifier and TypeMethodDescriptionaddMember(ColumnMetadata colSchema) voidaddMember(AbstractObjectWriter colWriter) voidbindWriter(UnionWriterImpl writer) booleanhasType(TypeProtos.MinorType type) booleanintReturn the last write position in the vector.member(TypeProtos.MinorType type) Return an existing writer for the given type, or create a new one if needed.intPosition within the vector of the first value for the current row.voidsetNull()voidsetType(TypeProtos.MinorType type) Methods inherited from interface org.apache.drill.exec.vector.accessor.writer.WriterEvents
bindIndex, bindListener, dump, endArrayValue, endWrite, postRollover, preRollover, restartRow, saveRow, startRow, startWriteMethods inherited from interface org.apache.drill.exec.vector.accessor.WriterPosition
writeIndex
-
Method Details
-
bindWriter
-
setNull
void setNull() -
hasType
-
member
Return an existing writer for the given type, or create a new one if needed.- Parameters:
type- desired variant type- Returns:
- a writer for that type
-
setType
-
lastWriteIndex
int lastWriteIndex()Description copied from interface:WriterPositionReturn the last write position in the vector. This may be the same as the writer index position (if the vector was written at that point), or an earlier point. In either case, this value points to the last valid value in the vector.- Specified by:
lastWriteIndexin interfaceWriterPosition- Returns:
- index of the last valid value in the vector
-
rowStartIndex
int rowStartIndex()Description copied from interface:WriterPositionPosition within the vector of the first value for the current row. Note that this is always the first value for the row, even for a writer deeply nested within a hierarchy of arrays. (The first position for the current array is not exposed in this API.)- Specified by:
rowStartIndexin interfaceWriterPosition- Returns:
- the vector offset of the first value for the current row
-
addMember
-
addMember
-
addMember
-
isProjected
boolean isProjected()
-