public class StructVector extends NonNullableStructVector implements FieldVector
| Modifier and Type | Class and Description |
|---|---|
protected class |
StructVector.NullableStructTransferPair
TransferPair for this (nullable) StructVector. |
NonNullableStructVector.StructTransferPairAbstractStructVector.ConflictPolicy| Modifier and Type | Field and Description |
|---|---|
protected ArrowBuf |
validityBuffer |
field, valueCountallowConflictPolicyChangesallocator, callBack, name| Constructor and Description |
|---|
StructVector(Field field,
BufferAllocator allocator,
CallBack callBack)
Constructs a new instance.
|
StructVector(Field field,
BufferAllocator allocator,
CallBack callBack,
AbstractStructVector.ConflictPolicy conflictPolicy,
boolean allowConflictPolicyChanges)
Constructs a new instance.
|
StructVector(String name,
BufferAllocator allocator,
FieldType fieldType,
CallBack callBack)
Constructs a new instance.
|
StructVector(String name,
BufferAllocator allocator,
FieldType fieldType,
CallBack callBack,
AbstractStructVector.ConflictPolicy conflictPolicy,
boolean allowConflictPolicyChanges)
Constructs a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
allocateNewSafe()
Allocates new buffers.
|
void |
clear()
Same as
close(). |
void |
close()
Close the vector and release the associated buffers.
|
static StructVector |
empty(String name,
BufferAllocator allocator) |
static StructVector |
emptyWithDuplicates(String name,
BufferAllocator allocator) |
void |
get(int index,
ComplexHolder holder) |
ArrowBuf[] |
getBuffers(boolean clear)
Return the underlying buffers associated with this vector.
|
int |
getBufferSize()
Get the size (number of bytes) of underlying buffers used by this vector.
|
int |
getBufferSizeFor(int valueCount)
Get the potential buffer size for a particular number of records.
|
ArrowBuf |
getDataBuffer()
Gets the underlying buffer associated with data vector.
|
long |
getDataBufferAddress()
Gets the starting address of the underlying buffer associated with data vector.
|
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.
|
int |
getNullCount()
Return the number of null values in the vector.
|
Map<String,?> |
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.
|
NullableStructReaderImpl |
getReader()
Get a reader for this vector.
|
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 |
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()
Get the current value capacity for the vector.
|
NullableStructWriter |
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.
|
boolean |
isNull(int index)
Returns true if the value at the provided index is null.
|
int |
isSet(int index)
Returns true the value at the given index is set (i.e.
|
void |
loadFieldBuffers(ArrowFieldNode fieldNode,
List<ArrowBuf> ownBuffers)
Loads data in the vectors.
|
TransferPair |
makeTransferPair(ValueVector to)
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 this vector to empty, does not release buffers.
|
void |
setIndexDefined(int index)
Marks the value at index as being set.
|
void |
setInitialCapacity(int numRecords)
Set the initial record capacity.
|
void |
setInitialCapacity(int numRecords,
double density)
Set value with density.
|
void |
setNull(int index)
Marks the value at index as null/not set.
|
void |
setValueCount(int valueCount)
Set number of values in the vector.
|
accept, copyFrom, copyFromSafe, fieldNameIterator, getChildrenFromFields, getField, getMinorType, getValueCount, getVectorById, getVectorById, initializeChildrenFromFields, supportsDirectReadadd, addOrGet, getChild, getChildByOrdinal, getChildFieldNames, getChildren, getChildVectorWithOrdinal, getConflictPolicy, getPrimitiveVectors, iterator, putChild, putVector, setConflictPolicy, size, toStringaddOrGetFixedSizeList, addOrGetList, addOrGetMap, addOrGetStruct, addOrGetUnion, allocateNew, getAllocator, getChild, getName, typeifyclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitexportBuffer, exportCDataBuffers, getChildrenFromFields, initializeChildrenFromFieldsaccept, allocateNew, copyFrom, copyFromSafe, getAllocator, getField, getMinorType, getName, getValueCount, validate, validateFullforEach, iterator, spliteratorprotected ArrowBuf validityBuffer
public StructVector(String name, BufferAllocator allocator, FieldType fieldType, CallBack callBack)
name - The name of the instance.allocator - The allocator to use to allocating/reallocating buffers.fieldType - The type of this list.callBack - A schema change callback.public StructVector(String name, BufferAllocator allocator, FieldType fieldType, CallBack callBack, AbstractStructVector.ConflictPolicy conflictPolicy, boolean allowConflictPolicyChanges)
name - The name of the instance.allocator - The allocator to use to allocating/reallocating buffers.fieldType - The type of this list.callBack - A schema change callback.conflictPolicy - policy to determine how duplicate names are handled.allowConflictPolicyChanges - whether duplicate names are allowed at all.public StructVector(Field field, BufferAllocator allocator, CallBack callBack)
field - The field materialized by this vector.allocator - The allocator to use to allocating/reallocating buffers.callBack - A schema change callback.public StructVector(Field field, BufferAllocator allocator, CallBack callBack, AbstractStructVector.ConflictPolicy conflictPolicy, boolean allowConflictPolicyChanges)
field - The field materialized by this vector.allocator - The allocator to use to allocating/reallocating buffers.callBack - A schema change callback.conflictPolicy - policy to determine how duplicate names are handled.allowConflictPolicyChanges - whether duplicate names are allowed at all.public static StructVector empty(String name, BufferAllocator allocator)
public static StructVector emptyWithDuplicates(String name, BufferAllocator allocator)
public 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 NullableStructReaderImpl getReader()
ValueVectorgetReader in interface ValueVectorgetReader in class NonNullableStructVectorfield reader that supports reading values
from this vector.public NullableStructWriter getWriter()
public TransferPair getTransferPair(BufferAllocator allocator)
ValueVectorgetTransferPair in interface ValueVectorgetTransferPair in class NonNullableStructVectorallocator - the target allocatortransfer pair, creating a new target vector of
the same type.public TransferPair makeTransferPair(ValueVector to)
ValueVectormakeTransferPair in interface ValueVectormakeTransferPair in class NonNullableStructVectorto - the target for the transfertransfer pair that is used to transfer underlying
buffers into the target vector.public TransferPair getTransferPair(String ref, BufferAllocator allocator)
ValueVectorgetTransferPair in interface ValueVectorgetTransferPair in class NonNullableStructVectorref - 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 ValueVectorgetTransferPair in class NonNullableStructVectorref - 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 ValueVectorgetTransferPair in class NonNullableStructVectorfield - 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 ValueVectorgetTransferPair in class NonNullableStructVectorfield - 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 int getValueCapacity()
getValueCapacity in interface ValueVectorgetValueCapacity in class NonNullableStructVectorpublic ArrowBuf[] getBuffers(boolean clear)
getBuffers in interface ValueVectorgetBuffers in class AbstractStructVectorclear - 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 void close()
close in interface Closeableclose in interface AutoCloseableclose in interface ValueVectorclose in class NonNullableStructVectorpublic void clear()
close().clear in interface ValueVectorclear in class NonNullableStructVectorpublic void reset()
reset in interface ValueVectorreset in class NonNullableStructVectorpublic int getBufferSize()
getBufferSize in interface ValueVectorgetBufferSize in class NonNullableStructVectorpublic int getBufferSizeFor(int valueCount)
getBufferSizeFor in interface ValueVectorgetBufferSizeFor in class NonNullableStructVectorvalueCount - desired number of elements in the vectorpublic void setInitialCapacity(int numRecords)
ValueVectorsetInitialCapacity in interface ValueVectorsetInitialCapacity in class NonNullableStructVectornumRecords - the initial record capacity.public void setInitialCapacity(int numRecords,
double density)
DensityAwareVectorsetInitialCapacity in interface DensityAwareVectorsetInitialCapacity in class NonNullableStructVectornumRecords - the number of values in this vectordensity - the density of the vectorpublic boolean allocateNewSafe()
ValueVectorallocateNewSafe in interface ValueVectorallocateNewSafe in class AbstractStructVectorpublic void reAlloc()
ValueVectorreAlloc in interface ValueVectorreAlloc in class AbstractStructVectorpublic long getValidityBufferAddress()
FieldVectorgetValidityBufferAddress in interface FieldVectorpublic long getDataBufferAddress()
FieldVectorgetDataBufferAddress in interface FieldVectorpublic long getOffsetBufferAddress()
FieldVectorgetOffsetBufferAddress in interface FieldVectorpublic ArrowBuf getValidityBuffer()
ValueVectorgetValidityBuffer in interface ValueVectorgetValidityBuffer in class NonNullableStructVectorpublic ArrowBuf getDataBuffer()
ValueVectorgetDataBuffer in interface ValueVectorgetDataBuffer in class NonNullableStructVectorpublic ArrowBuf getOffsetBuffer()
ValueVectorgetOffsetBuffer in interface ValueVectorgetOffsetBuffer in class NonNullableStructVectorpublic Map<String,?> getObject(int index)
ValueVectorgetObject in interface ValueVectorgetObject in class NonNullableStructVectorindex - index of object to getpublic int hashCode(int index)
ValueVectorhashCode in interface ValueVectorhashCode in class NonNullableStructVectorpublic int hashCode(int index,
ArrowBufHasher hasher)
ValueVectorhashCode in interface ValueVectorhashCode in class NonNullableStructVectorpublic void get(int index,
ComplexHolder holder)
get in class NonNullableStructVectorpublic int getNullCount()
getNullCount in interface ValueVectorgetNullCount in class NonNullableStructVectorpublic boolean isNull(int index)
isNull in interface ValueVectorisNull in class NonNullableStructVectorindex - index to check for nullpublic int isSet(int index)
public void setIndexDefined(int index)
public void setNull(int index)
setNull in interface FieldVectorindex - the value to changepublic void setValueCount(int valueCount)
ValueVectorsetValueCount in interface ValueVectorsetValueCount in class NonNullableStructVectorCopyright © 2024 The Apache Software Foundation. All rights reserved.