Class AbstractArrayWriter.BaseArrayWriter
java.lang.Object
org.apache.drill.exec.vector.accessor.writer.AbstractArrayWriter
org.apache.drill.exec.vector.accessor.writer.AbstractArrayWriter.BaseArrayWriter
- All Implemented Interfaces:
ArrayWriter
,ColumnWriter
,WriterEvents
,WriterPosition
- Direct Known Subclasses:
ObjectArrayWriter
,ScalarArrayWriter
- Enclosing class:
- AbstractArrayWriter
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.drill.exec.vector.accessor.writer.AbstractArrayWriter
AbstractArrayWriter.ArrayElementWriterIndex, AbstractArrayWriter.ArrayObjectWriter, AbstractArrayWriter.BaseArrayWriter
Nested classes/interfaces inherited from interface org.apache.drill.exec.vector.accessor.writer.WriterEvents
WriterEvents.ColumnWriterListener, WriterEvents.State
-
Field Summary
Fields inherited from class org.apache.drill.exec.vector.accessor.writer.AbstractArrayWriter
elementIndex, elementObjWriter, offsetsWriter, outerIndex
-
Constructor Summary
ConstructorDescriptionBaseArrayWriter
(ColumnMetadata schema, UInt4Vector offsetVector, AbstractObjectWriter elementObjWriter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
bindIndex
(ColumnWriterIndex index) Bind the writer to a writer index.void
dump
(HierarchicalFormatter format) void
End a value.void
endWrite()
End a batch: finalize any vector values.int
Return the last write position in the vector.void
The vectors backing this writer rolled over.void
The vectors backing this vector are about to roll over.void
During a writer to a row, rewind the the current index position to restart the row.void
saveRow()
Saves a row.void
startRow()
Start a new row.void
Start a write (batch) operation.Methods inherited from class org.apache.drill.exec.vector.accessor.writer.AbstractArrayWriter
array, bindListener, copy, dict, entry, entryType, isProjected, nullable, offsetWriter, rowStartIndex, scalar, schema, setNull, setNull, size, tuple, type, variant, writeIndex
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.drill.exec.vector.accessor.ArrayWriter
save
Methods inherited from interface org.apache.drill.exec.vector.accessor.ColumnWriter
setObject
-
Constructor Details
-
BaseArrayWriter
public BaseArrayWriter(ColumnMetadata schema, UInt4Vector offsetVector, AbstractObjectWriter elementObjWriter)
-
-
Method Details
-
bindIndex
Description copied from interface:WriterEvents
Bind the writer to a writer index.- Parameters:
index
- the writer index (top level or nested for arrays)
-
startWrite
public void startWrite()Description copied from interface:WriterEvents
Start a write (batch) operation. Performs any vector initialization required at the start of a batch (especially for offset vectors.) -
startRow
public void startRow()Description copied from interface:WriterEvents
Start a new row. To be called only when a row is not active. To restart a row, callWriterEvents.restartRow()
instead. -
endArrayValue
public void endArrayValue()Description copied from interface:WriterEvents
End a value. Similar toWriterEvents.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. -
restartRow
public void restartRow()Description copied from interface:WriterEvents
During a writer to a row, rewind the the current index position to restart the row. Done when abandoning the current row, such as when filtering out a row at read time. -
saveRow
public void saveRow()Description copied from interface:WriterEvents
Saves a row. Commits offset vector locations and advances each to the next position. Can be called only when a row is active. -
preRollover
public void preRollover()Description copied from interface:WriterEvents
The vectors backing this vector are about to roll over. Finish the current batch up to, but not including, the current row. -
postRollover
public void postRollover()Description copied from interface:WriterEvents
The vectors backing this writer rolled over. This means that data for the current row has been rolled over into a new vector. Offsets and indexes should be shifted based on the understanding that data for the current row now resides at the start of a new vector instead of its previous location elsewhere in an old vector. -
endWrite
public void endWrite()Description copied from interface:WriterEvents
End a batch: finalize any vector values. -
lastWriteIndex
public 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
- Overrides:
lastWriteIndex
in classAbstractArrayWriter
- Returns:
- index of the last valid value in the vector
-
dump
- Specified by:
dump
in interfaceWriterEvents
- Overrides:
dump
in classAbstractArrayWriter
-