public class DummyScalarWriter extends AbstractScalarWriterImpl
AbstractScalarWriterImpl.ScalarObjectWriter
WriterEvents.ColumnWriterListener, WriterEvents.State
schema, vectorIndex
Constructor and Description |
---|
DummyScalarWriter(ColumnMetadata schema) |
Modifier and Type | Method and Description |
---|---|
void |
appendBytes(byte[] value,
int len) |
void |
bindIndex(ColumnWriterIndex index)
Bind the writer to a writer index.
|
void |
bindListener(WriterEvents.ColumnWriterListener listener)
Bind a listener to the underlying vector writer.
|
void |
copy(ColumnReader from)
Copy a single value from the given reader, which must be of the
same type as this writer.
|
void |
endWrite()
End a batch: finalize any vector values.
|
boolean |
isProjected()
Whether this writer is projected (is backed by a materialized vector),
or is unprojected (is just a dummy writer.) In most cases, clients can
ignore whether the column is projected and just write to the writer.
|
int |
lastWriteIndex()
Return the last write position in the vector.
|
boolean |
nullable()
Whether this writer allows nulls.
|
void |
postRollover()
The vectors backing this writer rolled over.
|
void |
preRollover()
The vectors backing this vector are about to roll over.
|
void |
restartRow()
During a writer to a row, rewind the the current index position to
restart the row.
|
int |
rowStartIndex()
Position within the vector of the first value for the current row.
|
void |
setBoolean(boolean value) |
void |
setBytes(byte[] value,
int len) |
void |
setDate(LocalDate value) |
void |
setDecimal(BigDecimal value) |
void |
setDefaultValue(Object value)
Set the default value to be used to fill empties for this writer.
|
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.
|
ValueType |
valueType()
Describe the type of the value.
|
BaseDataValueVector |
vector() |
bindSchema, dump, endArrayValue, saveRow, schema, startRow, startWrite, type, writeIndex
conversionError, extendedType, setObject, toString
public DummyScalarWriter(ColumnMetadata schema)
public void bindListener(WriterEvents.ColumnWriterListener listener)
WriterEvents
bindListener
in interface WriterEvents
bindListener
in class AbstractScalarWriter
listener
- the vector event listener to bindpublic ValueType valueType()
ScalarWriter
public boolean nullable()
ColumnWriter
TypeProtos.DataMode.OPTIONAL
type in the schema. List entries
are nullable, if they are primitive, but not if they are maps or lists.
Unions are nullable, regardless of cardinality.ColumnWriter.setNull()
is supported, false
if notpublic void setNull()
ColumnWriter
public void setBoolean(boolean value)
public void setInt(int value)
public void setLong(long value)
public void setFloat(float value)
public void setDouble(double value)
public void setString(String value)
public void setBytes(byte[] value, int len)
public void appendBytes(byte[] value, int len)
public void setDecimal(BigDecimal value)
public void setPeriod(org.joda.time.Period value)
public void bindIndex(ColumnWriterIndex index)
WriterEvents
bindIndex
in interface WriterEvents
bindIndex
in class AbstractScalarWriterImpl
index
- the writer index (top level or nested for
arrays)public void restartRow()
WriterEvents
public void endWrite()
WriterEvents
public void preRollover()
WriterEvents
public void postRollover()
WriterEvents
public int lastWriteIndex()
WriterPosition
public BaseDataValueVector vector()
vector
in class AbstractScalarWriterImpl
public int rowStartIndex()
WriterPosition
rowStartIndex
in interface WriterPosition
rowStartIndex
in class AbstractScalarWriterImpl
public void setDate(LocalDate value)
public void setTime(LocalTime value)
public void setTimestamp(Instant value)
public void setValue(Object value)
ValueWriter
Primarily to be used when the code already knows the object type.
value
- a value that matches the primary setter above, or null
to set the column to nullfor the generic case
public void setDefaultValue(Object value)
ScalarWriter
value
- the value to set. Cannot be null. The type of the value
must match that legal for ValueWriter.setValue(Object)
public boolean isProjected()
ColumnWriter
isProjected
in interface ColumnWriter
isProjected
in class AbstractScalarWriterImpl
public void copy(ColumnReader from)
ColumnWriter
from
- reader to provide the dataCopyright © 1970 The Apache Software Foundation. All rights reserved.