Class AbstractScalarWriter

java.lang.Object
org.apache.drill.exec.vector.accessor.writer.AbstractScalarWriter
All Implemented Interfaces:
ColumnWriter, ScalarWriter, ValueWriter
Direct Known Subclasses:
AbstractScalarWriterImpl

public abstract class AbstractScalarWriter extends Object implements ScalarWriter
Base class for concrete scalar column writers including actual vector writers, and wrappers for nullable types.
  • Constructor Details

    • AbstractScalarWriter

      public AbstractScalarWriter()
  • Method Details

    • extendedType

      public ValueType extendedType()
      Description copied from interface: ScalarWriter
      The extended type of the value, describes the secondary type for DATE, TIME and TIMESTAMP for which the value type is int or long.
      Specified by:
      extendedType in interface ScalarWriter
    • 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
      Parameters:
      value - value to write to the vector. The Java type of the object indicates the Drill storage type
    • conversionError

      protected UnsupportedConversionError conversionError(String javaType)
    • bindListener

      public void bindListener(WriterEvents.ColumnWriterListener listener)
    • toString

      public String toString()
      Overrides:
      toString in class Object