Package org.apache.arrow.vector
Interface VariableWidthFieldVector
- All Superinterfaces:
AutoCloseable
,Closeable
,DensityAwareVector
,ElementAddressableVector
,FieldVector
,Iterable<ValueVector>
,ValueVector
,VariableWidthVector
,VectorDefinitionSetter
- All Known Implementing Classes:
BaseLargeVariableWidthVector
,BaseVariableWidthVector
,BaseVariableWidthViewVector
,LargeVarBinaryVector
,LargeVarCharVector
,VarBinaryVector
,VarCharVector
,ViewVarBinaryVector
,ViewVarCharVector
public interface VariableWidthFieldVector
extends VariableWidthVector, FieldVector, VectorDefinitionSetter
A base interface for common functionalities in variable width vectors.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
fillEmpties
(int index) Create holes in the vector upto the given index (exclusive).byte[]
get
(int index) Get the variable length element at the specified index.int
Get the index of the last non-null element in the vector.int
getValueLength
(int index) Get the variable length element at specified index as Text.void
read
(int index, ReusableBuffer<?> buffer) Get the variable length element at the specified index using a ReusableBuffer.void
set
(int index, byte[] value) Set the variable length element at the specified index to the supplied byte array.void
set
(int index, byte[] value, int start, int length) Set the variable length element at the specified index to the supplied byte array.void
set
(int index, ByteBuffer value, int start, int length) Set the variable length element at the specified index to the supplied ByteBuffer.void
setLastSet
(int value) Set the index of the last non-null element in the vector.void
setSafe
(int index, byte[] value) Set the variable length element at the specified index to the supplied byte array, and it handles the case where index and length of a new element are beyond the existing capacity of the vector.void
setSafe
(int index, byte[] value, int start, int length) Set the variable length element at the specified index to the supplied byte array, and it handles the case where index and length of a new element are beyond the existing capacity.void
setSafe
(int index, ByteBuffer value, int start, int length) Set the variable length element at the specified index to the supplied ByteBuffer, and it handles the case where index and length of a new element are beyond the existing capacity.void
setValueLengthSafe
(int index, int length) Sets the value length for an element.Methods inherited from interface org.apache.arrow.vector.DensityAwareVector
setInitialCapacity
Methods inherited from interface org.apache.arrow.vector.ElementAddressableVector
getDataPointer, getDataPointer
Methods inherited from interface org.apache.arrow.vector.FieldVector
exportBuffer, exportCDataBuffers, getChildrenFromFields, getDataBufferAddress, getExportedCDataBufferCount, getFieldBuffers, getFieldInnerVectors, getOffsetBufferAddress, getValidityBufferAddress, initializeChildrenFromFields, loadFieldBuffers, setNull
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface org.apache.arrow.vector.ValueVector
accept, allocateNew, allocateNewSafe, clear, close, copyFrom, copyFromSafe, getAllocator, getBuffers, getBufferSize, getBufferSizeFor, getDataBuffer, getField, getMinorType, getName, getNullCount, getObject, getOffsetBuffer, getReader, getTransferPair, getTransferPair, getTransferPair, getTransferPair, getTransferPair, getValidityBuffer, getValueCapacity, getValueCount, hashCode, hashCode, isNull, makeTransferPair, reAlloc, reset, setInitialCapacity, setValueCount, validate, validateFull
Methods inherited from interface org.apache.arrow.vector.VariableWidthVector
allocateNew, allocateNew, getByteCapacity, sizeOfValueBuffer
Methods inherited from interface org.apache.arrow.vector.VectorDefinitionSetter
setIndexDefined
-
Method Details
-
set
void set(int index, byte[] value) Set the variable length element at the specified index to the supplied byte array.- Parameters:
index
- position of the element to setvalue
- array of bytes with data
-
set
void set(int index, byte[] value, int start, int length) Set the variable length element at the specified index to the supplied byte array.- Parameters:
index
- position of the element to setvalue
- array of bytes with datastart
- start position in the arraylength
- length of the data to write
-
set
Set the variable length element at the specified index to the supplied ByteBuffer.- Parameters:
index
- position of the element to setvalue
- ByteBuffer with datastart
- start position in the ByteBufferlength
- length of the data to write
-
setSafe
void setSafe(int index, byte[] value) Set the variable length element at the specified index to the supplied byte array, and it handles the case where index and length of a new element are beyond the existing capacity of the vector.- Parameters:
index
- position of the element to setvalue
- array of bytes to write
-
setSafe
void setSafe(int index, byte[] value, int start, int length) Set the variable length element at the specified index to the supplied byte array, and it handles the case where index and length of a new element are beyond the existing capacity.- Parameters:
index
- position of the element to setvalue
- array of bytes with datastart
- start position in the arraylength
- length of the data to write
-
setSafe
Set the variable length element at the specified index to the supplied ByteBuffer, and it handles the case where index and length of a new element are beyond the existing capacity.- Parameters:
index
- position of the element to setvalue
- ByteBuffer with datastart
- start position in the ByteBufferlength
- length of the data to write
-
get
byte[] get(int index) Get the variable length element at the specified index.- Parameters:
index
- position of the element to get- Returns:
- byte array with the data
-
read
Get the variable length element at the specified index using a ReusableBuffer.- Parameters:
index
- position of the element to getbuffer
- ReusableBuffer to write the data to
-
getLastSet
int getLastSet()Get the index of the last non-null element in the vector.- Returns:
- index of the last non-null element
-
setLastSet
void setLastSet(int value) Set the index of the last non-null element in the vector.- Parameters:
value
- desired index of last non-null element
-
getValueLength
int getValueLength(int index) Get the variable length element at specified index as Text.- Parameters:
index
- position of an element to get- Returns:
- greater than length 0 for a non-null element, 0 otherwise
-
fillEmpties
void fillEmpties(int index) Create holes in the vector upto the given index (exclusive). Holes will be created from the current last-set position in the vector.- Parameters:
index
- target index
-
setValueLengthSafe
void setValueLengthSafe(int index, int length) Sets the value length for an element.- Parameters:
index
- position of the element to setlength
- length of the element
-