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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendBytes(byte[] value, int len) voidsetBoolean(boolean value) voidsetBytes(byte[] value, int len) voidvoidsetDecimal(BigDecimal value) voidsetDouble(double value) voidsetFloat(float value) voidsetInt(int value) voidsetLong(long value) voidsetNull()Set the current value to null.voidsetPeriod(org.joda.time.Period value) voidvoidvoidsetTimestamp(Instant value) voidWrite 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:ValueWriterSet the current value to null. throws IllegalStateException if called on a non-nullable value.- Specified by:
setNullin interfaceValueWriter
-
setBoolean
public void setBoolean(boolean value) - Specified by:
setBooleanin interfaceValueWriter
-
setInt
public void setInt(int value) - Specified by:
setIntin interfaceValueWriter
-
setLong
public void setLong(long value) - Specified by:
setLongin interfaceValueWriter
-
setFloat
public void setFloat(float value) - Specified by:
setFloatin interfaceValueWriter
-
setDouble
public void setDouble(double value) - Specified by:
setDoublein interfaceValueWriter
-
setString
- Specified by:
setStringin interfaceValueWriter
-
setBytes
public void setBytes(byte[] value, int len) - Specified by:
setBytesin interfaceValueWriter
-
appendBytes
public void appendBytes(byte[] value, int len) - Specified by:
appendBytesin interfaceValueWriter
-
setDecimal
- Specified by:
setDecimalin interfaceValueWriter
-
setPeriod
public void setPeriod(org.joda.time.Period value) - Specified by:
setPeriodin interfaceValueWriter
-
setDate
- Specified by:
setDatein interfaceValueWriter
-
setTime
- Specified by:
setTimein interfaceValueWriter
-
setTimestamp
- Specified by:
setTimestampin interfaceValueWriter
-
setValue
Description copied from interface:ValueWriterWrite 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:
setValuein interfaceValueWriter- Parameters:
value- a value that matches the primary setter above, or null to set the column to null- See Also:
-