Class DictEntryWriter
java.lang.Object
org.apache.drill.exec.vector.accessor.writer.AbstractTupleWriter
org.apache.drill.exec.vector.accessor.writer.DictEntryWriter
- All Implemented Interfaces:
ColumnWriter
,TupleWriter
,WriterEvents
,WriterPosition
Writer for a Dict entry. The entry is a special kind of tuple.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.drill.exec.vector.accessor.writer.AbstractTupleWriter
AbstractTupleWriter.TupleObjectWriter, AbstractTupleWriter.TupleWriterListener
Nested classes/interfaces inherited from interface org.apache.drill.exec.vector.accessor.TupleWriter
TupleWriter.UndefinedColumnException
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.AbstractTupleWriter
childIndex, listener, logger, state, tupleSchema, vectorIndex, writers
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
bindIndex
(ColumnWriterIndex index) Bind the writer to a writer index.buildDictEntryWriter
(ColumnMetadata schema, List<AbstractObjectWriter> keyValueWriters, DictVector vector) boolean
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.schema()
Returns the schema of the column associated with this writer.void
Generic technique to write data as a generic Java object.Methods inherited from class org.apache.drill.exec.vector.accessor.writer.AbstractTupleWriter
addColumn, addColumn, addColumnWriter, array, array, bindIndex, bindListener, bindListener, column, column, copy, dict, dict, dump, endArrayValue, endWrite, isProjected, lastWriteIndex, listener, nullable, postRollover, preRollover, restartRow, rowStartIndex, saveRow, scalar, scalar, set, setNull, size, startRow, startWrite, tuple, tuple, tupleSchema, type, type, type, variant, variant, writeIndex
-
Constructor Details
-
DictEntryWriter
-
-
Method Details
-
buildDictEntryWriter
public static DictEntryWriter.DictEntryObjectWriter buildDictEntryWriter(ColumnMetadata schema, List<AbstractObjectWriter> keyValueWriters, DictVector vector) -
bindIndex
Description copied from interface:WriterEvents
Bind the writer to a writer index.- Specified by:
bindIndex
in interfaceWriterEvents
- Overrides:
bindIndex
in classAbstractTupleWriter
- Parameters:
index
- the writer index (top level or nested for arrays)
-
isProjected
public boolean isProjected()Description copied from interface:ColumnWriter
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. This flag handles those special cases where it is helpful to know if the column is projected or not.- Specified by:
isProjected
in interfaceColumnWriter
- Overrides:
isProjected
in classAbstractTupleWriter
-
schema
Description copied from interface:ColumnWriter
Returns the schema of the column associated with this writer.- Returns:
- schema for this writer's column
-
setObject
Description copied from interface:ColumnWriter
Generic technique to write data as a generic Java object. The type of the object must match the target writer. Primarily for testing.- Scalar: The type of the Java object must match the type of the target vector. String or byte[] can be used for Varchar vectors.
- Array: Write the array given an array of values. The object must be a Java array. The type of the array must match the type of element in the repeated vector. That is, if the vector is a Repeated Int, provide an int[] array.
- Tuple (map or row): The Java object must be an array of objects in which the members of the array have a 1:1 correspondence with the members of the tuple in the order defined by the writer metadata. That is, if the map is (Int, Varchar), provide a Object[] array like this: {10, "fred"}.
- Union: Uses the Java object type to determine the type of the backing vector. Creates a vector of the required type if needed.
- Specified by:
setObject
in interfaceColumnWriter
- Overrides:
setObject
in classAbstractTupleWriter
- Parameters:
value
- value to write to the vector. The Java type of the object indicates the Drill storage type
-