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

public class DictEntryWriter extends AbstractTupleWriter
Writer for a Dict entry. The entry is a special kind of tuple.
  • Constructor Details

  • Method Details

    • buildDictEntryWriter

      public static DictEntryWriter.DictEntryObjectWriter buildDictEntryWriter(ColumnMetadata schema, List<AbstractObjectWriter> keyValueWriters, DictVector vector)
    • bindIndex

      public void bindIndex(ColumnWriterIndex index)
      Description copied from interface: WriterEvents
      Bind the writer to a writer index.
      Specified by:
      bindIndex in interface WriterEvents
      Overrides:
      bindIndex in class AbstractTupleWriter
      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 interface ColumnWriter
      Overrides:
      isProjected in class AbstractTupleWriter
    • schema

      public ColumnMetadata schema()
      Description copied from interface: ColumnWriter
      Returns the schema of the column associated with this writer.
      Returns:
      schema for this writer's column
    • setObject

      public void setObject(Object value)
      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 interface ColumnWriter
      Overrides:
      setObject in class AbstractTupleWriter
      Parameters:
      value - value to write to the vector. The Java type of the object indicates the Drill storage type