Class DirectConverter
java.lang.Object
org.apache.drill.exec.physical.impl.scan.convert.ColumnConverter
org.apache.drill.exec.physical.impl.scan.convert.DirectConverter
- All Implemented Interfaces:
ValueWriter
- Direct Known Subclasses:
AbstractConvertFromString
,ConvertBooleanToString
,ConvertDateToString
,ConvertDecimalToString
,ConvertDoubleToDecimal
,ConvertDoubleToString
,ConvertFloatToDecimal
,ConvertIntervalToString
,ConvertIntToDecimal
,ConvertIntToString
,ConvertLongToDecimal
,ConvertLongToString
,ConvertTimeStampToString
,ConvertTimeToString
Base class for Java type-based conversion. Use this base class if your
reader works with Java types, but you need to convert from one Java
type to another (such as decoding a byte array, converting a string
to a number, etc.)
Instances of this class can be freely mixed with "plain"
ScalarWriter
instances to avoid unnecessary calls when there
is a direct mapping from reader Java type to Drill type. You only need
insert converters for those columns where some conversion step is needed.
-
Field Summary
Fields inherited from class org.apache.drill.exec.physical.impl.scan.convert.ColumnConverter
baseWriter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendBytes
(byte[] value, int len) void
setBoolean
(boolean value) void
setBytes
(byte[] value, int len) void
void
setDecimal
(BigDecimal value) void
setDouble
(double value) void
setFloat
(float value) void
setInt
(int value) void
setLong
(long value) void
setNull()
Set the current value to null.void
setPeriod
(org.joda.time.Period value) void
void
void
setTimestamp
(Instant value) void
Write value to a vector as a Java object of the "native" type for the column.Methods inherited from class org.apache.drill.exec.physical.impl.scan.convert.ColumnConverter
conversionError, schema, writer
-
Constructor Details
-
DirectConverter
-
-
Method Details
-
setNull
public void setNull()Description copied from interface:ValueWriter
Set the current value to null. throws IllegalStateException if called on a non-nullable value.- Specified by:
setNull
in interfaceValueWriter
-
setBoolean
public void setBoolean(boolean value) - Specified by:
setBoolean
in interfaceValueWriter
-
setInt
public void setInt(int value) - Specified by:
setInt
in interfaceValueWriter
-
setLong
public void setLong(long value) - Specified by:
setLong
in interfaceValueWriter
-
setFloat
public void setFloat(float value) - Specified by:
setFloat
in interfaceValueWriter
-
setDouble
public void setDouble(double value) - Specified by:
setDouble
in interfaceValueWriter
-
setString
- Specified by:
setString
in interfaceValueWriter
-
setBytes
public void setBytes(byte[] value, int len) - Specified by:
setBytes
in interfaceValueWriter
-
appendBytes
public void appendBytes(byte[] value, int len) - Specified by:
appendBytes
in interfaceValueWriter
-
setDecimal
- Specified by:
setDecimal
in interfaceValueWriter
-
setPeriod
public void setPeriod(org.joda.time.Period value) - Specified by:
setPeriod
in interfaceValueWriter
-
setDate
- Specified by:
setDate
in interfaceValueWriter
-
setTime
- Specified by:
setTime
in interfaceValueWriter
-
setTimestamp
- Specified by:
setTimestamp
in interfaceValueWriter
-
setValue
Description copied from interface:ValueWriter
Write value to a vector as a Java object of the "native" type for the column. This form is available only on scalar writers. The object must be of the form for the primary write method above.Primarily to be used when the code already knows the object type.
- Specified by:
setValue
in interfaceValueWriter
- Parameters:
value
- a value that matches the primary setter above, or null to set the column to null- See Also:
-