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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected UnsupportedConversionError
conversionError
(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.void
Generic 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, wait
Methods inherited from interface org.apache.drill.exec.vector.accessor.ColumnWriter
copy, isProjected, nullable, schema, setNull, type
Methods inherited from interface org.apache.drill.exec.vector.accessor.ScalarWriter
setDefaultValue, valueType
Methods 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: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 interfaceScalarWriter
-
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
- Parameters:
value
- value to write to the vector. The Java type of the object indicates the Drill storage type
-
conversionError
-
bindListener
-
toString
-