Class AbstractScalarWriter
java.lang.Object
org.apache.drill.exec.vector.accessor.writer.AbstractScalarWriter
- All Implemented Interfaces:
ColumnWriter,ScalarWriter,ValueWriter
- Direct Known Subclasses:
AbstractScalarWriterImpl
Base class for concrete scalar column writers including actual vector
writers, and wrappers for nullable types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected UnsupportedConversionErrorconversionError(String javaType) The extended type of the value, describes the secondary type for DATE, TIME and TIMESTAMP for which the value type is int or long.voidGeneric technique to write data as a generic Java object.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.drill.exec.vector.accessor.ColumnWriter
copy, isProjected, nullable, schema, setNull, typeMethods inherited from interface org.apache.drill.exec.vector.accessor.ScalarWriter
setDefaultValue, valueTypeMethods inherited from interface org.apache.drill.exec.vector.accessor.ValueWriter
appendBytes, setBoolean, setBytes, setDate, setDecimal, setDouble, setFloat, setInt, setLong, setNull, setPeriod, setString, setTime, setTimestamp, setValue
-
Constructor Details
-
AbstractScalarWriter
public AbstractScalarWriter()
-
-
Method Details
-
extendedType
Description copied from interface:ScalarWriterThe 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:
extendedTypein interfaceScalarWriter
-
setObject
Description copied from interface:ColumnWriterGeneric 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:
setObjectin interfaceColumnWriter- Parameters:
value- value to write to the vector. The Java type of the object indicates the Drill storage type
-
conversionError
-
bindListener
-
toString
-