public class NonNullableStructVector extends AbstractStructVector
AbstractStructVector.| Modifier and Type | Class and Description |
|---|---|
protected static class |
NonNullableStructVector.StructTransferPair
TransferPair for this this class. |
AbstractStructVector.ConflictPolicy| Modifier and Type | Field and Description |
|---|---|
protected Field |
field |
int |
valueCount |
allowConflictPolicyChangesallocator, callBack, name| Constructor and Description |
|---|
NonNullableStructVector(Field field,
BufferAllocator allocator,
CallBack callBack)
Constructs a new instance.
|
NonNullableStructVector(Field field,
BufferAllocator allocator,
CallBack callBack,
AbstractStructVector.ConflictPolicy conflictPolicy,
boolean allowConflictPolicyChanges)
Constructs a new instance.
|
NonNullableStructVector(String name,
BufferAllocator allocator,
FieldType fieldType,
CallBack callBack)
Constructs a new instance.
|
NonNullableStructVector(String name,
BufferAllocator allocator,
FieldType fieldType,
CallBack callBack,
AbstractStructVector.ConflictPolicy conflictPolicy,
boolean allowConflictPolicyChanges)
Constructs a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
<OUT,IN> OUT |
accept(VectorVisitor<OUT,IN> visitor,
IN value)
Accept a generic
VectorVisitor and return the result. |
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 fromIndex,
int thisIndex,
ValueVector from)
Copies the element at fromIndex in the provided vector to thisIndex.
|
void |
copyFromSafe(int fromIndex,
int thisIndex,
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 NonNullableStructVector |
empty(String name,
BufferAllocator allocator) |
static NonNullableStructVector |
emptyWithDuplicates(String name,
BufferAllocator allocator) |
Iterator<String> |
fieldNameIterator() |
void |
get(int index,
ComplexHolder holder) |
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() |
ArrowBuf |
getDataBuffer()
Gets the underlying buffer associated with data vector.
|
Field |
getField()
Get information about how this field is materialized.
|
Types.MinorType |
getMinorType() |
int |
getNullCount()
Returns number of null elements 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.
|
FieldReader |
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.
|
int |
getValueCapacity()
Returns the maximum number of values that can be stored in this vector instance.
|
int |
getValueCount()
Gets the number of values.
|
ValueVector |
getVectorById(int id) |
<V extends ValueVector> |
getVectorById(int id,
Class<V> clazz)
Gets a child vector by ordinal position and casts to the specified class.
|
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 struct's members from the given Fields.
|
boolean |
isNull(int index)
Check whether an element in the vector is null.
|
TransferPair |
makeTransferPair(ValueVector to)
Makes a new transfer pair used to transfer underlying buffers.
|
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 |
setValueCount(int valueCount)
Set number of values in the vector.
|
protected boolean |
supportsDirectRead() |
add, addOrGet, allocateNewSafe, getBuffers, getChild, getChildByOrdinal, getChildFieldNames, getChildren, getChildVectorWithOrdinal, getConflictPolicy, getPrimitiveVectors, iterator, putChild, putVector, reAlloc, setConflictPolicy, size, toStringaddOrGetFixedSizeList, addOrGetList, addOrGetMap, addOrGetStruct, addOrGetUnion, allocateNew, getAllocator, getChild, getName, typeifyclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitvalidate, validateFullforEach, spliteratorprotected Field field
public int valueCount
public NonNullableStructVector(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.public NonNullableStructVector(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 NonNullableStructVector(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 - How to handle duplicate field names in the struct.public NonNullableStructVector(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 - How to handle duplicate field names in the struct.public static NonNullableStructVector empty(String name, BufferAllocator allocator)
public static NonNullableStructVector emptyWithDuplicates(String name, BufferAllocator allocator)
public FieldReader getReader()
ValueVectorfield reader that supports reading values
from this vector.public void copyFrom(int fromIndex,
int thisIndex,
ValueVector from)
copyFrom in interface ValueVectorcopyFrom in class AbstractContainerVectorfromIndex - position to copy from in source vectorthisIndex - position to copy to in this vectorfrom - source vectorpublic void copyFromSafe(int fromIndex,
int thisIndex,
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 AbstractContainerVectorfromIndex - position to copy from in source vectorthisIndex - position to copy to in this vectorfrom - source vectorprotected boolean supportsDirectRead()
supportsDirectRead in class AbstractContainerVectorpublic void setInitialCapacity(int numRecords)
ValueVectornumRecords - the initial record capacity.public void setInitialCapacity(int valueCount,
double density)
DensityAwareVectorvalueCount - the number of values in this vectordensity - the density of the vectorpublic int getBufferSize()
ValueVectorgetBufferSize in interface ValueVectorgetBufferSize in class AbstractStructVectorpublic int getBufferSizeFor(int valueCount)
ValueVectorvalueCount - the number of values to assume this vector containspublic ArrowBuf getValidityBuffer()
ValueVectorpublic ArrowBuf getDataBuffer()
ValueVectorpublic ArrowBuf getOffsetBuffer()
ValueVectorpublic TransferPair getTransferPair(BufferAllocator allocator)
ValueVectorallocator - the target allocatortransfer pair, creating a new target vector of
the same type.public TransferPair getTransferPair(String ref, BufferAllocator allocator, CallBack callBack)
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 makeTransferPair(ValueVector to)
ValueVectorto - the target for the transfertransfer pair that is used to transfer underlying
buffers into the target vector.public TransferPair getTransferPair(String ref, BufferAllocator allocator)
ValueVectorref - the name of the vectorallocator - the target allocatortransfer pair, creating a new target vector of
the same type.public TransferPair getTransferPair(Field field, BufferAllocator allocator)
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)
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 int getValueCapacity()
ValueVectorpublic Map<String,?> getObject(int index)
ValueVectorindex - index of object to getpublic int hashCode(int index)
ValueVectorpublic int hashCode(int index,
ArrowBufHasher hasher)
ValueVectorpublic <OUT,IN> OUT accept(VectorVisitor<OUT,IN> visitor, IN value)
ValueVectorVectorVisitor and return the result.OUT - the output result type.IN - the input data together with visitor.public boolean isNull(int index)
ValueVectorindex - index to check for nullpublic int getNullCount()
ValueVectorpublic void get(int index,
ComplexHolder holder)
public int getValueCount()
ValueVectorpublic ValueVector getVectorById(int id)
public <V extends ValueVector> V getVectorById(int id, Class<V> clazz)
public void setValueCount(int valueCount)
ValueVectorpublic void clear()
ValueVectorpublic void reset()
ValueVectorpublic Field getField()
ValueVectorpublic Types.MinorType getMinorType()
public void close()
AbstractContainerVectorclose in interface Closeableclose in interface AutoCloseableclose in interface ValueVectorclose in class AbstractStructVectorpublic void initializeChildrenFromFields(List<Field> children)
public List<FieldVector> getChildrenFromFields()
Copyright © 2024 The Apache Software Foundation. All rights reserved.