public class NullVector extends Object implements FieldVector
| Constructor and Description |
|---|
NullVector()
Deprecated.
|
NullVector(Field field)
Instantiate a NullVector.
|
NullVector(Field field,
int valueCount)
Instantiate a NullVector with the given number of values.
|
NullVector(String name)
Instantiate a NullVector.
|
NullVector(String name,
FieldType fieldType)
Instantiate a NullVector.
|
NullVector(String name,
int valueCount)
Instantiate a NullVector with the given number of values.
|
| 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 |
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 fromIndex,
int thisIndex,
ValueVector from)
Copy a cell value from a particular index in source vector to a particular
position in this vector.
|
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. |
BufferAllocator |
getAllocator() |
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.
|
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.
|
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.
|
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()
Returns the maximum number of values that can be stored in this vector instance.
|
int |
getValueCount()
Gets the number of values.
|
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)
Check whether an element in the vector is null.
|
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 |
setNull(int index)
Set the element at the given index to null.
|
void |
setValueCount(int valueCount)
Set number of values in the vector.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexportBuffer, exportCDataBuffersvalidate, validateFullforEach, spliteratorprotected Field field
public NullVector(String name)
name - name of the vectorpublic NullVector(String name, int valueCount)
name - name of the vectorvalueCount - number of values (i.e., nulls) in this vector.public NullVector(String name, FieldType fieldType)
name - name of the vectorfieldType - type of Field materialized by this vector.public NullVector(Field field)
field - field materialized by this vector.public NullVector(Field field, int valueCount)
field - field materialized by this vector.valueCount - number of values (i.e., nulls) in this vector.@Deprecated public NullVector()
public void close()
ValueVectorclose in interface Closeableclose in interface AutoCloseableclose in interface ValueVectorpublic void clear()
ValueVectorclear in interface ValueVectorpublic void reset()
ValueVectorreset in interface ValueVectorpublic Field getField()
ValueVectorgetField in interface ValueVectorpublic Types.MinorType getMinorType()
getMinorType 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 Iterator<ValueVector> iterator()
iterator in interface Iterable<ValueVector>public int getBufferSize()
ValueVectorgetBufferSize in interface ValueVectorpublic int getBufferSizeFor(int valueCount)
ValueVectorgetBufferSizeFor in interface ValueVectorvalueCount - 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 void allocateNew()
throws OutOfMemoryException
ValueVectorallocateNew in interface ValueVectorOutOfMemoryException - Thrown if no memory can be allocated.public boolean allocateNewSafe()
ValueVectorallocateNewSafe in interface ValueVectorpublic void reAlloc()
ValueVectorreAlloc in interface ValueVectorpublic BufferAllocator getAllocator()
getAllocator in interface ValueVectorpublic void setInitialCapacity(int numRecords)
ValueVectorsetInitialCapacity in interface ValueVectornumRecords - the initial record capacity.public int getValueCapacity()
ValueVectorgetValueCapacity in interface ValueVectorpublic 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(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(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, 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 FieldReader getReader()
ValueVectorgetReader in interface ValueVectorfield reader that supports reading values
from this vector.public 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 long getValidityBufferAddress()
FieldVectorgetValidityBufferAddress in interface FieldVectorpublic long getDataBufferAddress()
FieldVectorgetDataBufferAddress in interface FieldVectorpublic long getOffsetBufferAddress()
FieldVectorgetOffsetBufferAddress in interface FieldVectorpublic ArrowBuf getValidityBuffer()
ValueVectorgetValidityBuffer in interface ValueVectorpublic ArrowBuf getDataBuffer()
ValueVectorgetDataBuffer in interface ValueVectorpublic ArrowBuf getOffsetBuffer()
ValueVectorgetOffsetBuffer in interface ValueVectorpublic int getValueCount()
ValueVectorgetValueCount in interface ValueVectorpublic void setValueCount(int valueCount)
ValueVectorsetValueCount in interface ValueVectorpublic Object getObject(int index)
ValueVectorgetObject in interface ValueVectorindex - index of object to getpublic int getNullCount()
ValueVectorgetNullCount in interface ValueVectorpublic void setNull(int index)
setNull in interface FieldVectorindex - position of elementpublic boolean isNull(int index)
ValueVectorisNull in interface ValueVectorindex - index to check for nullpublic int hashCode(int index)
ValueVectorhashCode in interface ValueVectorpublic int hashCode(int index,
ArrowBufHasher hasher)
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 void copyFrom(int fromIndex,
int thisIndex,
ValueVector from)
ValueVectorcopyFrom in interface ValueVectorfromIndex - 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 ValueVectorfromIndex - position to copy from in source vectorthisIndex - position to copy to in this vectorfrom - source vectorpublic String getName()
ValueVectorgetName in interface ValueVectorCopyright © 2024 The Apache Software Foundation. All rights reserved.