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 classes/interfaces inherited from interface org.apache.drill.exec.vector.accessor.writer.WriterEvents
WriterEvents.ColumnWriterListener, WriterEvents.State
-
Method Summary
Modifier and TypeMethodDescriptionaddMember
(ColumnMetadata colSchema) void
addMember
(AbstractObjectWriter colWriter) void
bindWriter
(UnionWriterImpl writer) boolean
hasType
(TypeProtos.MinorType type) boolean
int
Return 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.int
Position within the vector of the first value for the current row.void
setNull()
void
setType
(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, startWrite
Methods 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:WriterPosition
Return 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:
lastWriteIndex
in interfaceWriterPosition
- Returns:
- index of the last valid value in the vector
-
rowStartIndex
int rowStartIndex()Description copied from interface:WriterPosition
Position 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:
rowStartIndex
in interfaceWriterPosition
- Returns:
- the vector offset of the first value for the current row
-
addMember
-
addMember
-
addMember
-
isProjected
boolean isProjected()
-