public abstract class BaseVarWidthWriter extends BaseScalarWriter
Most and value events are forwarded to the offset vector.
This class handles filling empty values with a default value. Doing so is trick as we must coordinate both this vector and the offset vector; checking for resize and overflow on each step. Also, when filling empties, we cannot use the normal "set" functions as they are what trigger the empty filling. Instead, we have to write to the "last write" position, not the current row positon.
AbstractScalarWriterImpl.ScalarObjectWriter
WriterEvents.ColumnWriterListener, WriterEvents.State
Modifier and Type | Field and Description |
---|---|
protected OffsetVectorWriterImpl |
offsetsWriter |
capacity, drillBuf, emptyValue, listener, MIN_BUFFER_SIZE
schema, vectorIndex
Constructor and Description |
---|
BaseVarWidthWriter(UInt4Vector offsetVector) |
Modifier and Type | Method and Description |
---|---|
void |
bindIndex(ColumnWriterIndex index)
Bind the writer to a writer index.
|
void |
dump(HierarchicalFormatter format) |
void |
endWrite()
End a batch: finalize any vector values.
|
int |
lastWriteIndex()
Return the last write position in the vector.
|
void |
postRollover()
The vectors backing this writer rolled over.
|
protected int |
prepareAppend(int width) |
protected int |
prepareWrite(int width) |
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.
|
protected void |
setBuffer()
All change of buffer comes through this function to allow capturing
the buffer address and capacity.
|
void |
skipNulls() |
void |
startRow()
Start a new row.
|
void |
startWrite()
Start a write (batch) operation.
|
appendBytes, bindListener, bindSchema, canExpand, nullable, overflowed, realloc, setBoolean, setBytes, setDate, setDecimal, setDouble, setFloat, setInt, setLong, setNull, setPeriod, setString, setTime, setTimestamp
endArrayValue, isProjected, rowStartIndex, saveRow, schema, type, vector, writeIndex
conversionError, extendedType, setObject, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setDefaultValue, valueType
copy
setValue
protected final OffsetVectorWriterImpl offsetsWriter
public BaseVarWidthWriter(UInt4Vector offsetVector)
public void bindIndex(ColumnWriterIndex index)
WriterEvents
bindIndex
in interface WriterEvents
bindIndex
in class AbstractScalarWriterImpl
index
- the writer index (top level or nested for
arrays)public void startWrite()
WriterEvents
startWrite
in interface WriterEvents
startWrite
in class AbstractScalarWriterImpl
public void startRow()
WriterEvents
WriterEvents.restartRow()
instead.startRow
in interface WriterEvents
startRow
in class AbstractScalarWriterImpl
protected final int prepareWrite(int width)
protected final int prepareAppend(int width)
protected final void setBuffer()
BaseScalarWriter
setBuffer
in class BaseScalarWriter
public void skipNulls()
skipNulls
in class BaseScalarWriter
public void restartRow()
WriterEvents
public int lastWriteIndex()
WriterPosition
public final void preRollover()
WriterEvents
public void postRollover()
WriterEvents
public final void endWrite()
WriterEvents
public void dump(HierarchicalFormatter format)
dump
in interface WriterEvents
dump
in class BaseScalarWriter
Copyright © 1970 The Apache Software Foundation. All rights reserved.