public class DummyArrayWriter extends AbstractArrayWriter
Experience may suggest that some methods must return non-dummy values, such as the number of items in the array. That can be added as needed.
| Modifier and Type | Class and Description |
|---|---|
static class |
DummyArrayWriter.DummyOffsetVectorWriter |
AbstractArrayWriter.ArrayElementWriterIndex, AbstractArrayWriter.ArrayObjectWriter, AbstractArrayWriter.BaseArrayWriterWriterEvents.ColumnWriterListener, WriterEvents.State| Modifier and Type | Field and Description |
|---|---|
static DummyArrayWriter.DummyOffsetVectorWriter |
offsetVectorWriter |
elementIndex, elementObjWriter, offsetsWriter, outerIndex| Constructor and Description |
|---|
DummyArrayWriter(ColumnMetadata schema,
AbstractObjectWriter elementWriter) |
| Modifier and Type | Method and Description |
|---|---|
void |
bindIndex(ColumnWriterIndex index)
Bind the writer to a writer index.
|
void |
copy(ColumnReader from)
Copy a single value from the given reader, which must be of the
same type as this writer.
|
void |
endArrayValue()
End a value.
|
void |
endWrite()
End a batch: finalize any vector values.
|
boolean |
isProjected()
Whether this writer is projected (is backed by a materialized vector),
or is unprojected (is just a dummy writer.) In most cases, clients can
ignore whether the column is projected and just write to the writer.
|
int |
lastWriteIndex()
Return the last write position in the vector.
|
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.
|
void |
save()
When the array contains a tuple or an array, call save()
after each array value.
|
void |
saveRow()
Saves a row.
|
void |
setObject(Object array)
Generic technique to write data as a generic Java object.
|
void |
startRow()
Start a new row.
|
void |
startWrite()
Start a write (batch) operation.
|
array, bindListener, dict, dump, entry, entryType, nullable, offsetWriter, rowStartIndex, scalar, schema, setNull, setNull, size, tuple, type, variant, writeIndexpublic static final DummyArrayWriter.DummyOffsetVectorWriter offsetVectorWriter
public DummyArrayWriter(ColumnMetadata schema, AbstractObjectWriter elementWriter)
public void save()
ArrayWriterpublic void setObject(Object array)
ColumnWriterarray - value to write to the vector. The Java type of the
object indicates the Drill storage typepublic void startWrite()
WriterEventspublic void startRow()
WriterEventsWriterEvents.restartRow() instead.public 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.public void restartRow()
WriterEventspublic void saveRow()
WriterEventspublic void endWrite()
WriterEventspublic void preRollover()
WriterEventspublic void postRollover()
WriterEventspublic int lastWriteIndex()
WriterPositionlastWriteIndex in interface WriterPositionlastWriteIndex in class AbstractArrayWriterpublic void bindIndex(ColumnWriterIndex index)
WriterEventsindex - the writer index (top level or nested for
arrays)public boolean isProjected()
ColumnWriterisProjected in interface ColumnWriterisProjected in class AbstractArrayWriterpublic void copy(ColumnReader from)
ColumnWritercopy in interface ColumnWritercopy in class AbstractArrayWriterfrom - reader to provide the dataCopyright © 2021 The Apache Software Foundation. All rights reserved.