public abstract class AbstractScalarWriterImpl extends AbstractScalarWriter implements WriterEvents
Modifier and Type | Class and Description |
---|---|
static class |
AbstractScalarWriterImpl.ScalarObjectWriter
Wraps a scalar writer and its event handler to provide a uniform
JSON-like interface for all writer types.
|
WriterEvents.ColumnWriterListener, WriterEvents.State
Modifier and Type | Field and Description |
---|---|
protected ColumnMetadata |
schema |
protected ColumnWriterIndex |
vectorIndex
Indicates the position in the vector to write.
|
Constructor and Description |
---|
AbstractScalarWriterImpl() |
Modifier and Type | Method and Description |
---|---|
void |
bindIndex(ColumnWriterIndex vectorIndex)
Bind the writer to a writer index.
|
void |
bindSchema(ColumnMetadata schema) |
void |
dump(HierarchicalFormatter format) |
void |
endArrayValue()
End a value.
|
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 |
rowStartIndex()
Position within the vector of the first value for the current row.
|
void |
saveRow()
Saves a row.
|
ColumnMetadata |
schema()
Returns the schema of the column associated with this writer.
|
void |
startRow()
Start a new row.
|
void |
startWrite()
Start a write (batch) operation.
|
ObjectType |
type()
Return the object (structure) type of this writer.
|
abstract BaseDataValueVector |
vector() |
int |
writeIndex()
Current write index for the writer.
|
bindListener, conversionError, extendedType, setObject, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
bindListener, endWrite, postRollover, preRollover, restartRow
lastWriteIndex
setDefaultValue, valueType
copy, nullable, setNull
appendBytes, setBoolean, setBytes, setDate, setDecimal, setDouble, setFloat, setInt, setLong, setNull, setPeriod, setString, setTime, setTimestamp, setValue
protected ColumnMetadata schema
protected ColumnWriterIndex vectorIndex
public ObjectType type()
ColumnWriter
type
in interface ColumnWriter
public void bindSchema(ColumnMetadata schema)
public void bindIndex(ColumnWriterIndex vectorIndex)
WriterEvents
bindIndex
in interface WriterEvents
vectorIndex
- the writer index (top level or nested for
arrays)public int rowStartIndex()
WriterPosition
rowStartIndex
in interface WriterPosition
public int writeIndex()
WriterPosition
writeIndex
in interface WriterPosition
public ColumnMetadata schema()
ColumnWriter
schema
in interface ColumnWriter
public abstract BaseDataValueVector vector()
public void startWrite()
WriterEvents
startWrite
in interface WriterEvents
public void startRow()
WriterEvents
WriterEvents.restartRow()
instead.startRow
in interface WriterEvents
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
public void saveRow()
WriterEvents
saveRow
in interface WriterEvents
public boolean isProjected()
ColumnWriter
isProjected
in interface ColumnWriter
public void dump(HierarchicalFormatter format)
dump
in interface WriterEvents
Copyright © 1970 The Apache Software Foundation. All rights reserved.