public class DirectConverter extends ColumnConverter implements ValueWriter
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.
baseWriter
Constructor and Description |
---|
DirectConverter(ScalarWriter colWriter) |
Modifier and Type | Method and Description |
---|---|
void |
appendBytes(byte[] value,
int len) |
void |
setBoolean(boolean value) |
void |
setBytes(byte[] value,
int len) |
void |
setDate(LocalDate value) |
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 |
setString(String value) |
void |
setTime(LocalTime value) |
void |
setTimestamp(Instant value) |
void |
setValue(Object value)
Write value to a vector as a Java object of the "native" type for
the column.
|
conversionError, schema, writer
public DirectConverter(ScalarWriter colWriter)
public void setNull()
ValueWriter
setNull
in interface ValueWriter
public void setBoolean(boolean value)
setBoolean
in interface ValueWriter
public void setInt(int value)
setInt
in interface ValueWriter
public void setLong(long value)
setLong
in interface ValueWriter
public void setFloat(float value)
setFloat
in interface ValueWriter
public void setDouble(double value)
setDouble
in interface ValueWriter
public void setString(String value)
setString
in interface ValueWriter
public void setBytes(byte[] value, int len)
setBytes
in interface ValueWriter
public void appendBytes(byte[] value, int len)
appendBytes
in interface ValueWriter
public void setDecimal(BigDecimal value)
setDecimal
in interface ValueWriter
public void setPeriod(org.joda.time.Period value)
setPeriod
in interface ValueWriter
public void setDate(LocalDate value)
setDate
in interface ValueWriter
public void setTime(LocalTime value)
setTime
in interface ValueWriter
public void setTimestamp(Instant value)
setTimestamp
in interface ValueWriter
public void setValue(Object value)
ValueWriter
Primarily to be used when the code already knows the object type.
setValue
in interface ValueWriter
value
- a value that matches the primary setter above, or null
to set the column to nullfor the generic case
Copyright © 1970 The Apache Software Foundation. All rights reserved.