public class UnionVector extends Object implements FieldVector
Modifier and Type | Field and Description |
---|---|
protected ArrowBuf |
typeBuffer |
Constructor and Description |
---|
UnionVector(String name,
BufferAllocator allocator,
CallBack callBack)
Deprecated.
|
UnionVector(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. |
FieldVector |
addVector(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()
Alternative to clear().
|
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. |
void |
directAddVector(FieldVector v)
Directly put a vector to internalStruct without creating a new one with same type.
|
static UnionVector |
empty(String name,
BufferAllocator allocator) |
byte[] |
get(int index) |
void |
get(int index,
ComplexHolder holder) |
void |
get(int index,
UnionHolder holder) |
BufferAllocator |
getAllocator() |
BigIntVector |
getBigIntVector() |
BigIntVector |
getBigIntVector(String name) |
BitVector |
getBitVector() |
BitVector |
getBitVector(String name) |
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 valueCount)
Returns the number of bytes that is used by this vector if it holds the given number
of values.
|
List<FieldVector> |
getChildrenFromFields()
The returned list is the same size as the list passed to initializeChildrenFromFields.
|
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() |
DateDayVector |
getDateDayVector(String name) |
DateMilliVector |
getDateMilliVector() |
DateMilliVector |
getDateMilliVector(String name) |
DecimalVector |
getDecimalVector() |
DecimalVector |
getDecimalVector(ArrowType arrowType) |
DecimalVector |
getDecimalVector(String name,
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.
|
Float4Vector |
getFloat4Vector() |
Float4Vector |
getFloat4Vector(String name) |
Float8Vector |
getFloat8Vector() |
Float8Vector |
getFloat8Vector(String name) |
IntervalDayVector |
getIntervalDayVector() |
IntervalDayVector |
getIntervalDayVector(String name) |
IntervalYearVector |
getIntervalYearVector() |
IntervalYearVector |
getIntervalYearVector(String name) |
IntVector |
getIntVector() |
IntVector |
getIntVector(String name) |
LargeVarBinaryVector |
getLargeVarBinaryVector() |
LargeVarBinaryVector |
getLargeVarBinaryVector(String name) |
LargeVarCharVector |
getLargeVarCharVector() |
LargeVarCharVector |
getLargeVarCharVector(String name) |
ListVector |
getList() |
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.
|
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() |
SmallIntVector |
getSmallIntVector(String name) |
StructVector |
getStruct() |
TimeMicroVector |
getTimeMicroVector() |
TimeMicroVector |
getTimeMicroVector(String name) |
TimeMilliVector |
getTimeMilliVector() |
TimeMilliVector |
getTimeMilliVector(String name) |
TimeNanoVector |
getTimeNanoVector() |
TimeNanoVector |
getTimeNanoVector(String name) |
TimeSecVector |
getTimeSecVector() |
TimeSecVector |
getTimeSecVector(String name) |
TimeStampMicroVector |
getTimeStampMicroVector() |
TimeStampMicroVector |
getTimeStampMicroVector(String name) |
TimeStampMilliVector |
getTimeStampMilliVector() |
TimeStampMilliVector |
getTimeStampMilliVector(String name) |
TimeStampNanoVector |
getTimeStampNanoVector() |
TimeStampNanoVector |
getTimeStampNanoVector(String name) |
TimeStampSecVector |
getTimeStampSecVector() |
TimeStampSecVector |
getTimeStampSecVector(String name) |
TinyIntVector |
getTinyIntVector() |
TinyIntVector |
getTinyIntVector(String name) |
TransferPair |
getTransferPair(BufferAllocator allocator)
To transfer quota responsibility.
|
TransferPair |
getTransferPair(String ref,
BufferAllocator allocator) |
TransferPair |
getTransferPair(String ref,
BufferAllocator allocator,
CallBack callBack) |
ArrowBuf |
getTypeBuffer() |
long |
getTypeBufferAddress() |
int |
getTypeValue(int index) |
UInt1Vector |
getUInt1Vector() |
UInt1Vector |
getUInt1Vector(String name) |
UInt2Vector |
getUInt2Vector() |
UInt2Vector |
getUInt2Vector(String name) |
UInt4Vector |
getUInt4Vector() |
UInt4Vector |
getUInt4Vector(String name) |
UInt8Vector |
getUInt8Vector() |
UInt8Vector |
getUInt8Vector(String name) |
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() |
VarBinaryVector |
getVarBinaryVector(String name) |
VarCharVector |
getVarCharVector() |
VarCharVector |
getVarCharVector(String name) |
ValueVector |
getVector(int index) |
ValueVector |
getVector(int index,
ArrowType arrowType) |
ValueVector |
getVectorByType(int typeId) |
ValueVector |
getVectorByType(int typeId,
ArrowType arrowType) |
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.
|
void |
reset()
Reset the ValueVector to the initial state without releasing any owned ArrowBuf.
|
void |
setInitialCapacity(int numRecords)
Set the initial record capacity.
|
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,
NullableDecimalHolder holder,
ArrowType arrowType) |
void |
setSafe(int index,
NullableFloat4Holder holder) |
void |
setSafe(int index,
NullableFloat8Holder holder) |
void |
setSafe(int index,
NullableIntervalDayHolder 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 |
setSafe(int index,
UnionHolder holder) |
void |
setSafe(int index,
UnionHolder holder,
ArrowType arrowType) |
void |
setType(int index,
Types.MinorType type) |
void |
setValueCount(int valueCount)
Set number of values in the vector.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected ArrowBuf typeBuffer
@Deprecated public UnionVector(String name, BufferAllocator allocator, CallBack callBack)
public UnionVector(String name, BufferAllocator allocator, FieldType fieldType, CallBack callBack)
public static UnionVector empty(String name, BufferAllocator allocator)
public BufferAllocator getAllocator()
getAllocator
in interface ValueVector
public Types.MinorType getMinorType()
getMinorType
in interface ValueVector
public void initializeChildrenFromFields(List<Field> children)
FieldVector
initializeChildrenFromFields
in interface FieldVector
children
- the schemapublic List<FieldVector> getChildrenFromFields()
FieldVector
getChildrenFromFields
in interface FieldVector
public void loadFieldBuffers(ArrowFieldNode fieldNode, List<ArrowBuf> ownBuffers)
FieldVector
loadFieldBuffers
in interface FieldVector
fieldNode
- the fieldNodeownBuffers
- the buffers for this Field (own buffers only, children not included)public List<ArrowBuf> getFieldBuffers()
FieldVector
getFieldBuffers
in interface FieldVector
@Deprecated public List<BufferBacked> getFieldInnerVectors()
FieldVector
getFieldInnerVectors
in interface FieldVector
public long getValidityBufferAddress()
FieldVector
getValidityBufferAddress
in interface FieldVector
public long getTypeBufferAddress()
public long getDataBufferAddress()
FieldVector
getDataBufferAddress
in interface FieldVector
public long getOffsetBufferAddress()
FieldVector
getOffsetBufferAddress
in interface FieldVector
public ArrowBuf getTypeBuffer()
public ArrowBuf getValidityBuffer()
ValueVector
getValidityBuffer
in interface ValueVector
public ArrowBuf getDataBuffer()
ValueVector
getDataBuffer
in interface ValueVector
public ArrowBuf getOffsetBuffer()
ValueVector
getOffsetBuffer
in interface ValueVector
public StructVector getStruct()
public TinyIntVector getTinyIntVector()
public TinyIntVector getTinyIntVector(String name)
public UInt1Vector getUInt1Vector()
public UInt1Vector getUInt1Vector(String name)
public UInt2Vector getUInt2Vector()
public UInt2Vector getUInt2Vector(String name)
public SmallIntVector getSmallIntVector()
public SmallIntVector getSmallIntVector(String name)
public IntVector getIntVector()
public UInt4Vector getUInt4Vector()
public UInt4Vector getUInt4Vector(String name)
public Float4Vector getFloat4Vector()
public Float4Vector getFloat4Vector(String name)
public DateDayVector getDateDayVector()
public DateDayVector getDateDayVector(String name)
public IntervalYearVector getIntervalYearVector()
public IntervalYearVector getIntervalYearVector(String name)
public TimeSecVector getTimeSecVector()
public TimeSecVector getTimeSecVector(String name)
public TimeMilliVector getTimeMilliVector()
public TimeMilliVector getTimeMilliVector(String name)
public BigIntVector getBigIntVector()
public BigIntVector getBigIntVector(String name)
public UInt8Vector getUInt8Vector()
public UInt8Vector getUInt8Vector(String name)
public Float8Vector getFloat8Vector()
public Float8Vector getFloat8Vector(String name)
public DateMilliVector getDateMilliVector()
public DateMilliVector getDateMilliVector(String name)
public TimeStampSecVector getTimeStampSecVector()
public TimeStampSecVector getTimeStampSecVector(String name)
public TimeStampMilliVector getTimeStampMilliVector()
public TimeStampMilliVector getTimeStampMilliVector(String name)
public TimeStampMicroVector getTimeStampMicroVector()
public TimeStampMicroVector getTimeStampMicroVector(String name)
public TimeStampNanoVector getTimeStampNanoVector()
public TimeStampNanoVector getTimeStampNanoVector(String name)
public TimeMicroVector getTimeMicroVector()
public TimeMicroVector getTimeMicroVector(String name)
public TimeNanoVector getTimeNanoVector()
public TimeNanoVector getTimeNanoVector(String name)
public IntervalDayVector getIntervalDayVector()
public IntervalDayVector getIntervalDayVector(String name)
public DecimalVector getDecimalVector(ArrowType arrowType)
public DecimalVector getDecimalVector(String name, ArrowType arrowType)
public DecimalVector getDecimalVector()
public VarBinaryVector getVarBinaryVector()
public VarBinaryVector getVarBinaryVector(String name)
public VarCharVector getVarCharVector()
public VarCharVector getVarCharVector(String name)
public LargeVarCharVector getLargeVarCharVector()
public LargeVarCharVector getLargeVarCharVector(String name)
public LargeVarBinaryVector getLargeVarBinaryVector()
public LargeVarBinaryVector getLargeVarBinaryVector(String name)
public BitVector getBitVector()
public ListVector getList()
public int getTypeValue(int index)
public void allocateNew() throws OutOfMemoryException
ValueVector
allocateNew
in interface ValueVector
OutOfMemoryException
- Thrown if no memory can be allocated.public boolean allocateNewSafe()
ValueVector
allocateNewSafe
in interface ValueVector
public void reAlloc()
ValueVector
reAlloc
in interface ValueVector
public void setInitialCapacity(int numRecords)
ValueVector
setInitialCapacity
in interface ValueVector
numRecords
- the initial record capacity.public int getValueCapacity()
ValueVector
getValueCapacity
in interface ValueVector
public void close()
ValueVector
close
in interface Closeable
close
in interface AutoCloseable
close
in interface ValueVector
public void clear()
ValueVector
clear
in interface ValueVector
public void reset()
ValueVector
reset
in interface ValueVector
public Field getField()
ValueVector
getField
in interface ValueVector
public TransferPair getTransferPair(BufferAllocator allocator)
ValueVector
getTransferPair
in interface ValueVector
allocator
- the target allocatortransfer pair
, creating a new target vector of
the same type.public TransferPair getTransferPair(String ref, BufferAllocator allocator)
getTransferPair
in interface ValueVector
public TransferPair getTransferPair(String ref, BufferAllocator allocator, CallBack callBack)
getTransferPair
in interface ValueVector
public TransferPair makeTransferPair(ValueVector target)
ValueVector
makeTransferPair
in interface ValueVector
target
- 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)
ValueVector
copyFrom
in interface ValueVector
inIndex
- position to copy from in source vectoroutIndex
- position to copy to in this vectorfrom
- source vectorpublic void copyFromSafe(int inIndex, int outIndex, ValueVector from)
ValueVector
ValueVector.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 ValueVector
inIndex
- position to copy from in source vectoroutIndex
- position to copy to in this vectorfrom
- source vectorpublic FieldVector addVector(FieldVector v)
public void directAddVector(FieldVector v)
public FieldReader getReader()
ValueVector
getReader
in interface ValueVector
field reader
that supports reading values
from this vector.public FieldWriter getWriter()
public int getBufferSize()
ValueVector
getBufferSize
in interface ValueVector
public int getBufferSizeFor(int valueCount)
ValueVector
getBufferSizeFor
in interface ValueVector
valueCount
- the number of values to assume this vector containspublic ArrowBuf[] getBuffers(boolean clear)
ValueVector
getBuffers
in interface ValueVector
clear
- 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 ValueVector getVector(int index)
public ValueVector getVector(int index, ArrowType arrowType)
public ValueVector getVectorByType(int typeId)
public ValueVector getVectorByType(int typeId, ArrowType arrowType)
public Object getObject(int index)
ValueVector
getObject
in interface ValueVector
index
- index of object to getpublic byte[] get(int index)
public void get(int index, ComplexHolder holder)
public void get(int index, UnionHolder holder)
public int getValueCount()
ValueVector
getValueCount
in interface ValueVector
public boolean isNull(int index)
isNull
in interface ValueVector
index
- index to check for nullpublic int getNullCount()
ValueVector
getNullCount
in interface ValueVector
public int isSet(int index)
public void setValueCount(int valueCount)
ValueVector
setValueCount
in interface ValueVector
public void setSafe(int index, UnionHolder holder)
public void setSafe(int index, UnionHolder holder, ArrowType arrowType)
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, 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, NullableDecimalHolder holder, ArrowType arrowType)
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 setType(int index, Types.MinorType type)
public int hashCode(int index)
ValueVector
hashCode
in interface ValueVector
public int hashCode(int index, ArrowBufHasher hasher)
ValueVector
hashCode
in interface ValueVector
public <OUT,IN> OUT accept(VectorVisitor<OUT,IN> visitor, IN value)
ValueVector
VectorVisitor
and return the result.accept
in interface ValueVector
OUT
- the output result type.IN
- the input data together with visitor.public String getName()
ValueVector
getName
in interface ValueVector
Copyright © 2020 The Apache Software Foundation. All rights reserved.