public class UnionMapWriter extends UnionListWriter
Writer for MapVectors. This extends UnionListWriter to simplify writing map entries to a list
of struct elements, with "key" and "value" fields. The procedure for writing a map begin with
startMap() followed by startEntry(). An entry is written by using the
key() writer to write the key, then the value() writer to write a value. After
writing the value, call endEntry() to complete the entry. Each map can have 1 or more
entries. When done writing entries, call endMap() to complete the map.
NOTE: the MapVector can have NULL values by not writing to position. If a map is started with
startMap(), then it must have a key written. The value of a map entry can be NULL by
not using the value() writer.
Example to write the following map to position 5 of a vector
// {
// 1 -> 3,
// 2 -> 4,
// 3 -> NULL
// }
UnionMapWriter writer = ...
writer.setPosition(5);
writer.startMap();
writer.startEntry();
writer.key().integer().writeInt(1);
writer.value().integer().writeInt(3);
writer.endEntry();
writer.startEntry();
writer.key().integer().writeInt(2);
writer.value().integer().writeInt(4);
writer.endEntry();
writer.startEntry();
writer.key().integer().writeInt(3);
writer.endEntry();
writer.endMap();
BaseWriter.ComplexWriter, BaseWriter.ListWriter, BaseWriter.MapWriter, BaseWriter.ScalarWriter, BaseWriter.StructOrListWriter, BaseWriter.StructWriter| Modifier and Type | Field and Description |
|---|---|
protected boolean |
addVectorAsNullable |
vector, writer| Constructor and Description |
|---|
UnionMapWriter(MapVector vector) |
allocate, bigInt, bit, clear, close, dateDay, dateMilli, decimal, decimal, decimal256, decimal256, duration, duration, duration, end, endList, fixedSizeBinary, fixedSizeBinary, fixedSizeBinary, float2, float4, float8, getField, getValueCapacity, integer, intervalDay, intervalMonthDayNano, intervalYear, largeVarBinary, largeVarChar, list, map, map, map, setPosition, setValueCount, smallInt, start, startList, struct, timeMicro, timeMilli, timeNano, timeSec, timeStampMicro, timeStampMicroTZ, timeStampMicroTZ, timeStampMicroTZ, timeStampMilli, timeStampMilliTZ, timeStampMilliTZ, timeStampMilliTZ, timeStampNano, timeStampNanoTZ, timeStampNanoTZ, timeStampNanoTZ, timeStampSec, timeStampSecTZ, timeStampSecTZ, timeStampSecTZ, tinyInt, uInt1, uInt2, uInt4, uInt8, varBinary, varChar, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, write, writeBigEndianBytesToDecimal, writeBigEndianBytesToDecimal256, writeBigInt, writeBit, writeDateDay, writeDateMilli, writeDecimal, writeDecimal, writeDecimal, writeDecimal256, writeDecimal256, writeDecimal256, writeDuration, writeFixedSizeBinary, writeFloat2, writeFloat4, writeFloat8, writeInt, writeIntervalDay, writeIntervalMonthDayNano, writeIntervalYear, writeLargeVarBinary, writeLargeVarBinary, writeLargeVarBinary, writeLargeVarBinary, writeLargeVarBinary, writeLargeVarChar, writeLargeVarChar, writeLargeVarChar, writeNull, writeSmallInt, writeTimeMicro, writeTimeMilli, writeTimeNano, writeTimeSec, writeTimeStampMicro, writeTimeStampMicroTZ, writeTimeStampMilli, writeTimeStampMilliTZ, writeTimeStampNano, writeTimeStampNanoTZ, writeTimeStampSec, writeTimeStampSecTZ, writeTinyInt, writeUInt1, writeUInt2, writeUInt4, writeUInt8, writeVarBinary, writeVarBinary, writeVarBinary, writeVarBinary, writeVarBinary, writeVarChar, writeVarChar, writeVarCharclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetPositionpublic UnionMapWriter(MapVector vector)
public void startMap()
startMap in interface BaseWriter.MapWriterpublic void endMap()
endMap in interface BaseWriter.MapWriterpublic void startEntry()
key() and value()
writers. Call endEntry() to complete the entry.startEntry in interface BaseWriter.MapWriterpublic void endEntry()
endEntry in interface BaseWriter.MapWriterpublic UnionMapWriter key()
key in interface BaseWriter.MapWriterpublic UnionMapWriter value()
value in interface BaseWriter.MapWriterpublic TinyIntWriter tinyInt()
tinyInt in interface BaseWriter.ListWritertinyInt in class UnionListWriterpublic UInt1Writer uInt1()
uInt1 in interface BaseWriter.ListWriteruInt1 in class UnionListWriterpublic UInt2Writer uInt2()
uInt2 in interface BaseWriter.ListWriteruInt2 in class UnionListWriterpublic SmallIntWriter smallInt()
smallInt in interface BaseWriter.ListWritersmallInt in class UnionListWriterpublic Float2Writer float2()
float2 in interface BaseWriter.ListWriterfloat2 in class UnionListWriterpublic IntWriter integer()
integer in interface BaseWriter.ListWriterinteger in class UnionListWriterpublic UInt4Writer uInt4()
uInt4 in interface BaseWriter.ListWriteruInt4 in class UnionListWriterpublic Float4Writer float4()
float4 in interface BaseWriter.ListWriterfloat4 in class UnionListWriterpublic DateDayWriter dateDay()
dateDay in interface BaseWriter.ListWriterdateDay in class UnionListWriterpublic IntervalYearWriter intervalYear()
intervalYear in interface BaseWriter.ListWriterintervalYear in class UnionListWriterpublic TimeSecWriter timeSec()
timeSec in interface BaseWriter.ListWritertimeSec in class UnionListWriterpublic TimeMilliWriter timeMilli()
timeMilli in interface BaseWriter.ListWritertimeMilli in class UnionListWriterpublic BigIntWriter bigInt()
bigInt in interface BaseWriter.ListWriterbigInt in class UnionListWriterpublic UInt8Writer uInt8()
uInt8 in interface BaseWriter.ListWriteruInt8 in class UnionListWriterpublic Float8Writer float8()
float8 in interface BaseWriter.ListWriterfloat8 in class UnionListWriterpublic DateMilliWriter dateMilli()
dateMilli in interface BaseWriter.ListWriterdateMilli in class UnionListWriterpublic TimeStampSecWriter timeStampSec()
timeStampSec in interface BaseWriter.ListWritertimeStampSec in class UnionListWriterpublic TimeStampMilliWriter timeStampMilli()
timeStampMilli in interface BaseWriter.ListWritertimeStampMilli in class UnionListWriterpublic TimeStampMicroWriter timeStampMicro()
timeStampMicro in interface BaseWriter.ListWritertimeStampMicro in class UnionListWriterpublic TimeStampNanoWriter timeStampNano()
timeStampNano in interface BaseWriter.ListWritertimeStampNano in class UnionListWriterpublic TimeMicroWriter timeMicro()
timeMicro in interface BaseWriter.ListWritertimeMicro in class UnionListWriterpublic TimeNanoWriter timeNano()
timeNano in interface BaseWriter.ListWritertimeNano in class UnionListWriterpublic IntervalDayWriter intervalDay()
intervalDay in interface BaseWriter.ListWriterintervalDay in class UnionListWriterpublic IntervalMonthDayNanoWriter intervalMonthDayNano()
intervalMonthDayNano in interface BaseWriter.ListWriterintervalMonthDayNano in class UnionListWriterpublic VarBinaryWriter varBinary()
varBinary in interface BaseWriter.ListWritervarBinary in class UnionListWriterpublic VarCharWriter varChar()
varChar in interface BaseWriter.ListWritervarChar in class UnionListWriterpublic LargeVarCharWriter largeVarChar()
largeVarChar in interface BaseWriter.ListWriterlargeVarChar in class UnionListWriterpublic LargeVarBinaryWriter largeVarBinary()
largeVarBinary in interface BaseWriter.ListWriterlargeVarBinary in class UnionListWriterpublic BitWriter bit()
bit in interface BaseWriter.ListWriterbit in class UnionListWriterpublic DecimalWriter decimal()
decimal in interface BaseWriter.ListWriterdecimal in class UnionListWriterpublic Decimal256Writer decimal256()
decimal256 in interface BaseWriter.ListWriterdecimal256 in class UnionListWriterpublic BaseWriter.StructWriter struct()
struct in interface BaseWriter.ListWriterstruct in class UnionListWriterpublic BaseWriter.ListWriter list()
list in interface BaseWriter.ListWriterlist in class UnionListWriterpublic BaseWriter.MapWriter map(boolean keysSorted)
map in interface BaseWriter.ListWritermap in class UnionListWriterpublic void setAddVectorAsNullable(boolean nullable)
nullable - Whether or not to create nullable vectors (default behavior is true)public void writeBigEndianBytesToDecimal256(byte[] value)
writeBigEndianBytesToDecimal256 in interface Decimal256WriterDecimal256Writer.writeBigEndianBytesToDecimal256(byte[], ArrowType),
Decimal256Writer.write(Decimal256Holder)public void writeBigEndianBytesToDecimal(byte[] value)
writeBigEndianBytesToDecimal in interface DecimalWriterDecimalWriter.writeBigEndianBytesToDecimal(byte[], ArrowType),
DecimalWriter.write(DecimalHolder)public boolean isEmptyStruct()
false.
Must be overridden by struct writers.
isEmptyStruct in interface BaseWriter.StructWriterpublic void copyReader(FieldReader reader)
copyReader in interface BaseWriter.ListWriterpublic void copyReaderToField(String name, FieldReader reader)
copyReaderToField in interface BaseWriter.StructWriterpublic int getPosition()
getPosition in interface PositionableCopyright © 2024 The Apache Software Foundation. All rights reserved.