public class NullableScalarWriter extends AbstractScalarWriterImpl
Modifier and Type | Class and Description |
---|---|
static class |
NullableScalarWriter.ChildIndex |
AbstractScalarWriterImpl.ScalarObjectWriter
WriterEvents.ColumnWriterListener, WriterEvents.State
schema, vectorIndex
Constructor and Description |
---|
NullableScalarWriter(ColumnMetadata schema,
NullableVector nullableVector,
BaseScalarWriter baseWriter) |
Modifier and Type | Method and Description |
---|---|
void |
appendBytes(byte[] value,
int len) |
BaseScalarWriter |
baseWriter() |
void |
bindIndex(ColumnWriterIndex index)
Bind the writer to a writer index.
|
void |
bindListener(WriterEvents.ColumnWriterListener listener)
Bind a listener to the underlying vector writer.
|
BaseScalarWriter |
bitsWriter() |
static AbstractScalarWriterImpl.ScalarObjectWriter |
build(ColumnMetadata schema,
NullableVector nullableVector,
BaseScalarWriter baseWriter) |
void |
copy(ColumnReader from)
Copy a single value from the given reader, which must be of the
same type as this writer.
|
void |
dump(HierarchicalFormatter format) |
void |
endArrayValue()
End a value.
|
void |
endWrite()
End a batch: finalize any vector values.
|
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.
|
void |
startRow()
Start a new row.
|
void |
startWrite()
Start a write (batch) operation.
|
ValueType |
valueType()
Describe the type of the value.
|
BaseDataValueVector |
vector() |
bindSchema, isProjected, saveRow, schema, type, writeIndex
conversionError, extendedType, setObject, toString
public NullableScalarWriter(ColumnMetadata schema, NullableVector nullableVector, BaseScalarWriter baseWriter)
public static AbstractScalarWriterImpl.ScalarObjectWriter build(ColumnMetadata schema, NullableVector nullableVector, BaseScalarWriter baseWriter)
public BaseScalarWriter bitsWriter()
public BaseScalarWriter baseWriter()
public BaseDataValueVector vector()
vector
in class AbstractScalarWriterImpl
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 int rowStartIndex()
WriterPosition
rowStartIndex
in interface WriterPosition
rowStartIndex
in class AbstractScalarWriterImpl
public ValueType valueType()
ScalarWriter
public void restartRow()
WriterEvents
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 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 copy(ColumnReader from)
ColumnWriter
from
- reader to provide the datapublic void preRollover()
WriterEvents
public void postRollover()
WriterEvents
public int lastWriteIndex()
WriterPosition
public void bindListener(WriterEvents.ColumnWriterListener listener)
WriterEvents
bindListener
in interface WriterEvents
bindListener
in class AbstractScalarWriter
listener
- the vector event listener to bindpublic void startWrite()
WriterEvents
startWrite
in interface WriterEvents
startWrite
in class AbstractScalarWriterImpl
public void startRow()
WriterEvents
WriterEvents.restartRow()
instead.startRow
in interface WriterEvents
startRow
in class AbstractScalarWriterImpl
public void endArrayValue()
WriterEvents
WriterEvents.saveRow()
, but the save of a value
is conditional on saving the row. This version is primarily of use
in tuples nested inside arrays: it saves each tuple within the array,
advancing to a new position in the array. The update of the array's
offset vector based on the cumulative value saves is done when
saving the row.endArrayValue
in interface WriterEvents
endArrayValue
in class AbstractScalarWriterImpl
public void endWrite()
WriterEvents
public void dump(HierarchicalFormatter format)
dump
in interface WriterEvents
dump
in class AbstractScalarWriterImpl
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)
Copyright © 1970 The Apache Software Foundation. All rights reserved.