public class DenseUnionVector extends AbstractContainerVector implements FieldVector
| Modifier and Type | Field and Description |
|---|---|
static byte |
OFFSET_WIDTH |
static byte |
TYPE_WIDTH |
allocator, callBack, name| Constructor and Description |
|---|
DenseUnionVector(String name,
BufferAllocator allocator,
FieldType fieldType,
CallBack callBack) |
| Modifier and Type | Method and Description |
|---|---|
<OUT,IN> OUT |
accept(VectorVisitor<OUT,IN> visitor,
IN value)
Accept a generic
VectorVisitor and return the result. |
<T extends FieldVector> |
addOrGet(String name,
FieldType fieldType,
Class<T> clazz) |
FieldVector |
addVector(byte typeId,
FieldVector v) |
void |
allocateNew()
Allocate new buffers.
|
boolean |
allocateNewSafe()
Allocates new buffers.
|
void |
clear()
Release any owned ArrowBuf and reset the ValueVector to the initial state.
|
void |
close()
Clears out all underlying child vectors.
|
void |
copyFrom(int inIndex,
int outIndex,
ValueVector from)
Copy a cell value from a particular index in source vector to a particular
position in this vector.
|
void |
copyFromSafe(int inIndex,
int outIndex,
ValueVector from)
Same as
ValueVector.copyFrom(int, int, ValueVector) except that
it handles the case when the capacity of the vector needs to be expanded
before copy. |
static DenseUnionVector |
empty(String name,
BufferAllocator allocator) |
void |
get(int index,
DenseUnionHolder holder) |
BufferAllocator |
getAllocator() |
BigIntVector |
getBigIntVector(byte typeId) |
BitVector |
getBitVector(byte typeId) |
ArrowBuf[] |
getBuffers(boolean clear)
Return the underlying buffers associated with this vector.
|
int |
getBufferSize()
Get the number of bytes used by this vector.
|
int |
getBufferSizeFor(int count)
Returns the number of bytes that is used by this vector if it holds the given number
of values.
|
<T extends FieldVector> |
getChild(String name,
Class<T> clazz) |
List<FieldVector> |
getChildrenFromFields()
The returned list is the same size as the list passed to initializeChildrenFromFields.
|
VectorWithOrdinal |
getChildVectorWithOrdinal(String name) |
ArrowBuf |
getDataBuffer()
Gets the underlying buffer associated with data vector.
|
long |
getDataBufferAddress()
Gets the starting address of the underlying buffer associated with data vector.
|
DateDayVector |
getDateDayVector(byte typeId) |
DateMilliVector |
getDateMilliVector(byte typeId) |
Decimal256Vector |
getDecimal256Vector(byte typeId,
ArrowType arrowType) |
DecimalVector |
getDecimalVector(byte typeId,
ArrowType arrowType) |
Field |
getField()
Get information about how this field is materialized.
|
List<ArrowBuf> |
getFieldBuffers()
Get the buffers of the fields, (same size as getFieldVectors() since it is their content).
|
List<BufferBacked> |
getFieldInnerVectors()
Deprecated.
This API will be removed as the current implementations no longer support inner vectors.
|
Float2Vector |
getFloat2Vector(byte typeId) |
Float4Vector |
getFloat4Vector(byte typeId) |
Float8Vector |
getFloat8Vector(byte typeId) |
IntervalDayVector |
getIntervalDayVector(byte typeId) |
IntervalMonthDayNanoVector |
getIntervalMonthDayNanoVector(byte typeId) |
IntervalYearVector |
getIntervalYearVector(byte typeId) |
IntVector |
getIntVector(byte typeId) |
LargeVarBinaryVector |
getLargeVarBinaryVector(byte typeId) |
LargeVarCharVector |
getLargeVarCharVector(byte typeId) |
ListVector |
getList(byte typeId) |
MapVector |
getMap(byte typeId) |
Types.MinorType |
getMinorType() |
String |
getName()
Gets the name of the vector.
|
int |
getNullCount()
Returns number of null elements in the vector.
|
Object |
getObject(int index)
Get friendly type object from the vector.
|
int |
getOffset(int index) |
ArrowBuf |
getOffsetBuffer()
Gets the underlying buffer associated with offset vector.
|
long |
getOffsetBufferAddress()
Gets the starting address of the underlying buffer associated with offset vector.
|
FieldReader |
getReader()
Get a reader for this vector.
|
SmallIntVector |
getSmallIntVector(byte typeId) |
StructVector |
getStruct(byte typeId) |
TimeMicroVector |
getTimeMicroVector(byte typeId) |
TimeMilliVector |
getTimeMilliVector(byte typeId) |
TimeNanoVector |
getTimeNanoVector(byte typeId) |
TimeSecVector |
getTimeSecVector(byte typeId) |
TimeStampMicroVector |
getTimeStampMicroVector(byte typeId) |
TimeStampMilliVector |
getTimeStampMilliVector(byte typeId) |
TimeStampNanoVector |
getTimeStampNanoVector(byte typeId) |
TimeStampSecVector |
getTimeStampSecVector(byte typeId) |
TinyIntVector |
getTinyIntVector(byte typeId) |
TransferPair |
getTransferPair(BufferAllocator allocator)
To transfer quota responsibility.
|
TransferPair |
getTransferPair(Field field,
BufferAllocator allocator)
To transfer quota responsibility.
|
TransferPair |
getTransferPair(Field field,
BufferAllocator allocator,
CallBack callBack)
To transfer quota responsibility.
|
TransferPair |
getTransferPair(String ref,
BufferAllocator allocator)
To transfer quota responsibility.
|
TransferPair |
getTransferPair(String ref,
BufferAllocator allocator,
CallBack callBack)
To transfer quota responsibility.
|
ArrowBuf |
getTypeBuffer() |
byte |
getTypeId(int index) |
UInt1Vector |
getUInt1Vector(byte typeId) |
UInt2Vector |
getUInt2Vector(byte typeId) |
UInt4Vector |
getUInt4Vector(byte typeId) |
UInt8Vector |
getUInt8Vector(byte typeId) |
ArrowBuf |
getValidityBuffer()
Gets the underlying buffer associated with validity vector.
|
long |
getValidityBufferAddress()
Gets the starting address of the underlying buffer associated with validity vector.
|
int |
getValueCapacity()
Returns the maximum number of values that can be stored in this vector instance.
|
int |
getValueCount()
Gets the number of values.
|
VarBinaryVector |
getVarBinaryVector(byte typeId) |
VarCharVector |
getVarCharVector(byte typeId) |
ValueVector |
getVectorByType(byte typeId) |
FieldWriter |
getWriter() |
int |
hashCode(int index)
Returns hashCode of element in index with the default hasher.
|
int |
hashCode(int index,
ArrowBufHasher hasher)
Returns hashCode of element in index with the given hasher.
|
void |
initializeChildrenFromFields(List<Field> children)
Initializes the child vectors
to be later loaded with loadBuffers.
|
boolean |
isNull(int index)
IMPORTANT: Union types always return non null as there is no validity buffer.
|
int |
isSet(int index) |
Iterator<ValueVector> |
iterator() |
void |
loadFieldBuffers(ArrowFieldNode fieldNode,
List<ArrowBuf> ownBuffers)
Loads data in the vectors.
|
TransferPair |
makeTransferPair(ValueVector target)
Makes a new transfer pair used to transfer underlying buffers.
|
void |
reAlloc()
Allocate new buffer with double capacity, and copy data into the new buffer.
|
byte |
registerNewTypeId(Field field) |
void |
reset()
Reset the ValueVector to the initial state without releasing any owned ArrowBuf.
|
void |
setInitialCapacity(int numRecords)
Set the initial record capacity.
|
void |
setInitialCapacity(int valueCount,
double density)
Set value with density.
|
void |
setNull(int index)
Set the element at the given index to null.
|
void |
setOffset(int index,
int offset) |
void |
setSafe(int index,
DenseUnionHolder holder) |
void |
setSafe(int index,
NullableBigIntHolder holder) |
void |
setSafe(int index,
NullableBitHolder holder) |
void |
setSafe(int index,
NullableDateDayHolder holder) |
void |
setSafe(int index,
NullableDateMilliHolder holder) |
void |
setSafe(int index,
NullableDecimal256Holder holder) |
void |
setSafe(int index,
NullableDecimalHolder holder) |
void |
setSafe(int index,
NullableFloat2Holder holder) |
void |
setSafe(int index,
NullableFloat4Holder holder) |
void |
setSafe(int index,
NullableFloat8Holder holder) |
void |
setSafe(int index,
NullableIntervalDayHolder holder) |
void |
setSafe(int index,
NullableIntervalMonthDayNanoHolder holder) |
void |
setSafe(int index,
NullableIntervalYearHolder holder) |
void |
setSafe(int index,
NullableIntHolder holder) |
void |
setSafe(int index,
NullableLargeVarBinaryHolder holder) |
void |
setSafe(int index,
NullableLargeVarCharHolder holder) |
void |
setSafe(int index,
NullableSmallIntHolder holder) |
void |
setSafe(int index,
NullableTimeMicroHolder holder) |
void |
setSafe(int index,
NullableTimeMilliHolder holder) |
void |
setSafe(int index,
NullableTimeNanoHolder holder) |
void |
setSafe(int index,
NullableTimeSecHolder holder) |
void |
setSafe(int index,
NullableTimeStampMicroHolder holder) |
void |
setSafe(int index,
NullableTimeStampMilliHolder holder) |
void |
setSafe(int index,
NullableTimeStampNanoHolder holder) |
void |
setSafe(int index,
NullableTimeStampSecHolder holder) |
void |
setSafe(int index,
NullableTinyIntHolder holder) |
void |
setSafe(int index,
NullableUInt1Holder holder) |
void |
setSafe(int index,
NullableUInt2Holder holder) |
void |
setSafe(int index,
NullableUInt4Holder holder) |
void |
setSafe(int index,
NullableUInt8Holder holder) |
void |
setSafe(int index,
NullableVarBinaryHolder holder) |
void |
setSafe(int index,
NullableVarCharHolder holder) |
void |
setTypeId(int index,
byte typeId) |
void |
setValueCount(int valueCount)
Set number of values in the vector.
|
int |
size() |
addOrGetFixedSizeList, addOrGetList, addOrGetMap, addOrGetStruct, addOrGetUnion, getChild, supportsDirectRead, toString, typeifyclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitexportBuffer, exportCDataBuffersvalidate, validateFullforEach, spliteratorpublic static final byte TYPE_WIDTH
public static final byte OFFSET_WIDTH
public DenseUnionVector(String name, BufferAllocator allocator, FieldType fieldType, CallBack callBack)
public static DenseUnionVector empty(String name, BufferAllocator allocator)
public BufferAllocator getAllocator()
getAllocator in interface ValueVectorgetAllocator in class AbstractContainerVectorpublic Types.MinorType getMinorType()
getMinorType in interface ValueVectorpublic void initializeChildrenFromFields(List<Field> children)
FieldVectorinitializeChildrenFromFields in interface FieldVectorchildren - the schemapublic List<FieldVector> getChildrenFromFields()
FieldVectorgetChildrenFromFields in interface FieldVectorpublic void loadFieldBuffers(ArrowFieldNode fieldNode, List<ArrowBuf> ownBuffers)
FieldVectorloadFieldBuffers in interface FieldVectorfieldNode - the fieldNodeownBuffers - the buffers for this Field (own buffers only, children not included)public List<ArrowBuf> getFieldBuffers()
FieldVectorgetFieldBuffers in interface FieldVector@Deprecated public List<BufferBacked> getFieldInnerVectors()
getFieldInnerVectors in interface FieldVectorpublic byte registerNewTypeId(Field field)
public long getOffsetBufferAddress()
FieldVectorgetOffsetBufferAddress in interface FieldVectorpublic long getDataBufferAddress()
FieldVectorgetDataBufferAddress in interface FieldVectorpublic long getValidityBufferAddress()
FieldVectorgetValidityBufferAddress in interface FieldVectorpublic ArrowBuf getValidityBuffer()
ValueVectorgetValidityBuffer in interface ValueVectorpublic ArrowBuf getOffsetBuffer()
ValueVectorgetOffsetBuffer in interface ValueVectorpublic ArrowBuf getTypeBuffer()
public ArrowBuf getDataBuffer()
ValueVectorgetDataBuffer in interface ValueVectorpublic StructVector getStruct(byte typeId)
public TinyIntVector getTinyIntVector(byte typeId)
public UInt1Vector getUInt1Vector(byte typeId)
public UInt2Vector getUInt2Vector(byte typeId)
public SmallIntVector getSmallIntVector(byte typeId)
public Float2Vector getFloat2Vector(byte typeId)
public IntVector getIntVector(byte typeId)
public UInt4Vector getUInt4Vector(byte typeId)
public Float4Vector getFloat4Vector(byte typeId)
public DateDayVector getDateDayVector(byte typeId)
public IntervalYearVector getIntervalYearVector(byte typeId)
public TimeSecVector getTimeSecVector(byte typeId)
public TimeMilliVector getTimeMilliVector(byte typeId)
public BigIntVector getBigIntVector(byte typeId)
public UInt8Vector getUInt8Vector(byte typeId)
public Float8Vector getFloat8Vector(byte typeId)
public DateMilliVector getDateMilliVector(byte typeId)
public TimeStampSecVector getTimeStampSecVector(byte typeId)
public TimeStampMilliVector getTimeStampMilliVector(byte typeId)
public TimeStampMicroVector getTimeStampMicroVector(byte typeId)
public TimeStampNanoVector getTimeStampNanoVector(byte typeId)
public TimeMicroVector getTimeMicroVector(byte typeId)
public TimeNanoVector getTimeNanoVector(byte typeId)
public IntervalDayVector getIntervalDayVector(byte typeId)
public IntervalMonthDayNanoVector getIntervalMonthDayNanoVector(byte typeId)
public Decimal256Vector getDecimal256Vector(byte typeId, ArrowType arrowType)
public DecimalVector getDecimalVector(byte typeId, ArrowType arrowType)
public VarBinaryVector getVarBinaryVector(byte typeId)
public VarCharVector getVarCharVector(byte typeId)
public LargeVarCharVector getLargeVarCharVector(byte typeId)
public LargeVarBinaryVector getLargeVarBinaryVector(byte typeId)
public BitVector getBitVector(byte typeId)
public ListVector getList(byte typeId)
public MapVector getMap(byte typeId)
public byte getTypeId(int index)
public ValueVector getVectorByType(byte typeId)
public void allocateNew()
throws OutOfMemoryException
ValueVectorallocateNew in interface ValueVectorallocateNew in class AbstractContainerVectorOutOfMemoryException - Thrown if no memory can be allocated.public boolean allocateNewSafe()
ValueVectorallocateNewSafe in interface ValueVectorpublic void reAlloc()
ValueVectorreAlloc in interface ValueVectorpublic int getOffset(int index)
public void setInitialCapacity(int numRecords)
ValueVectorsetInitialCapacity in interface ValueVectornumRecords - the initial record capacity.public int getValueCapacity()
ValueVectorgetValueCapacity in interface ValueVectorpublic void close()
AbstractContainerVectorclose in interface Closeableclose in interface AutoCloseableclose in interface ValueVectorclose in class AbstractContainerVectorpublic void clear()
ValueVectorclear in interface ValueVectorpublic void reset()
ValueVectorreset in interface ValueVectorpublic Field getField()
ValueVectorgetField in interface ValueVectorpublic TransferPair getTransferPair(BufferAllocator allocator)
ValueVectorgetTransferPair in interface ValueVectorallocator - the target allocatortransfer pair, creating a new target vector of
the same type.public TransferPair getTransferPair(String ref, BufferAllocator allocator)
ValueVectorgetTransferPair in interface ValueVectorref - the name of the vectorallocator - the target allocatortransfer pair, creating a new target vector of
the same type.public TransferPair getTransferPair(String ref, BufferAllocator allocator, CallBack callBack)
ValueVectorgetTransferPair in interface ValueVectorref - the name of the vectorallocator - the target allocatorcallBack - A schema change callback.transfer pair, creating a new target vector of
the same type.public TransferPair getTransferPair(Field field, BufferAllocator allocator)
ValueVectorgetTransferPair in interface ValueVectorfield - the Field object used by the target vectorallocator - the target allocatortransfer pair, creating a new target vector of
the same type.public TransferPair getTransferPair(Field field, BufferAllocator allocator, CallBack callBack)
ValueVectorgetTransferPair in interface ValueVectorfield - the Field object used by the target vectorallocator - the target allocatorcallBack - A schema change callback.transfer pair, creating a new target vector of
the same type.public TransferPair makeTransferPair(ValueVector target)
ValueVectormakeTransferPair in interface ValueVectortarget - the target for the transfertransfer pair that is used to transfer underlying
buffers into the target vector.public void copyFrom(int inIndex,
int outIndex,
ValueVector from)
ValueVectorcopyFrom in interface ValueVectorcopyFrom in class AbstractContainerVectorinIndex - position to copy from in source vectoroutIndex - position to copy to in this vectorfrom - source vectorpublic void copyFromSafe(int inIndex,
int outIndex,
ValueVector from)
ValueVectorValueVector.copyFrom(int, int, ValueVector) except that
it handles the case when the capacity of the vector needs to be expanded
before copy.copyFromSafe in interface ValueVectorcopyFromSafe in class AbstractContainerVectorinIndex - position to copy from in source vectoroutIndex - position to copy to in this vectorfrom - source vectorpublic FieldVector addVector(byte typeId, FieldVector v)
public FieldReader getReader()
ValueVectorgetReader in interface ValueVectorfield reader that supports reading values
from this vector.public FieldWriter getWriter()
public int getBufferSize()
ValueVectorgetBufferSize in interface ValueVectorpublic int getBufferSizeFor(int count)
ValueVectorgetBufferSizeFor in interface ValueVectorcount - the number of values to assume this vector containspublic ArrowBuf[] getBuffers(boolean clear)
ValueVectorgetBuffers in interface ValueVectorclear - Whether to clear vector before returning; the buffers will still be refcounted;
but the returned array will be the only reference to thembuffers that is used by this vector instance.public Iterator<ValueVector> iterator()
iterator in interface Iterable<ValueVector>public Object getObject(int index)
ValueVectorgetObject in interface ValueVectorindex - index of object to getpublic void get(int index,
DenseUnionHolder holder)
public int getValueCount()
ValueVectorgetValueCount in interface ValueVectorpublic boolean isNull(int index)
isNull in interface ValueVectorindex - index to check for nullpublic int getNullCount()
ValueVectorgetNullCount in interface ValueVectorpublic int isSet(int index)
public void setValueCount(int valueCount)
ValueVectorsetValueCount in interface ValueVectorpublic void setSafe(int index,
DenseUnionHolder holder)
public void setSafe(int index,
NullableTinyIntHolder holder)
public void setSafe(int index,
NullableUInt1Holder holder)
public void setSafe(int index,
NullableUInt2Holder holder)
public void setSafe(int index,
NullableSmallIntHolder holder)
public void setSafe(int index,
NullableFloat2Holder holder)
public void setSafe(int index,
NullableIntHolder holder)
public void setSafe(int index,
NullableUInt4Holder holder)
public void setSafe(int index,
NullableFloat4Holder holder)
public void setSafe(int index,
NullableDateDayHolder holder)
public void setSafe(int index,
NullableIntervalYearHolder holder)
public void setSafe(int index,
NullableTimeSecHolder holder)
public void setSafe(int index,
NullableTimeMilliHolder holder)
public void setSafe(int index,
NullableBigIntHolder holder)
public void setSafe(int index,
NullableUInt8Holder holder)
public void setSafe(int index,
NullableFloat8Holder holder)
public void setSafe(int index,
NullableDateMilliHolder holder)
public void setSafe(int index,
NullableTimeStampSecHolder holder)
public void setSafe(int index,
NullableTimeStampMilliHolder holder)
public void setSafe(int index,
NullableTimeStampMicroHolder holder)
public void setSafe(int index,
NullableTimeStampNanoHolder holder)
public void setSafe(int index,
NullableTimeMicroHolder holder)
public void setSafe(int index,
NullableTimeNanoHolder holder)
public void setSafe(int index,
NullableIntervalDayHolder holder)
public void setSafe(int index,
NullableIntervalMonthDayNanoHolder holder)
public void setSafe(int index,
NullableDecimal256Holder holder)
public void setSafe(int index,
NullableDecimalHolder holder)
public void setSafe(int index,
NullableVarBinaryHolder holder)
public void setSafe(int index,
NullableVarCharHolder holder)
public void setSafe(int index,
NullableLargeVarCharHolder holder)
public void setSafe(int index,
NullableLargeVarBinaryHolder holder)
public void setSafe(int index,
NullableBitHolder holder)
public void setTypeId(int index,
byte typeId)
public void setOffset(int index,
int offset)
public int hashCode(int index,
ArrowBufHasher hasher)
ValueVectorhashCode in interface ValueVectorpublic int hashCode(int index)
ValueVectorhashCode in interface ValueVectorpublic <OUT,IN> OUT accept(VectorVisitor<OUT,IN> visitor, IN value)
ValueVectorVectorVisitor and return the result.accept in interface ValueVectorOUT - the output result type.IN - the input data together with visitor.public String getName()
ValueVectorgetName in interface ValueVectorgetName in class AbstractContainerVectorpublic <T extends FieldVector> T addOrGet(String name, FieldType fieldType, Class<T> clazz)
addOrGet in class AbstractContainerVectorpublic <T extends FieldVector> T getChild(String name, Class<T> clazz)
getChild in class AbstractContainerVectorpublic VectorWithOrdinal getChildVectorWithOrdinal(String name)
getChildVectorWithOrdinal in class AbstractContainerVectorpublic int size()
size in class AbstractContainerVectorpublic void setInitialCapacity(int valueCount,
double density)
DensityAwareVectorsetInitialCapacity in interface DensityAwareVectorvalueCount - the number of values in this vectordensity - the density of the vectorpublic void setNull(int index)
setNull in interface FieldVectorindex - position of elementUnsupportedOperationException - whenever invokedCopyright © 2024 The Apache Software Foundation. All rights reserved.