java.lang.Object
org.apache.arrow.vector.BaseValueVector
org.apache.arrow.vector.BaseVariableWidthViewVector
org.apache.arrow.vector.ViewVarCharVector
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<ValueVector>,DensityAwareVector,ElementAddressableVector,FieldVector,ValueIterableVector<Text>,ValueVector,VariableWidthFieldVector,VariableWidthVector,VectorDefinitionSetter
public final class ViewVarCharVector
extends BaseVariableWidthViewVector
implements ValueIterableVector<Text>
ViewVarCharVector implements a view of a variable width vector of VARCHAR values which could be
NULL. A validity buffer (bit vector) is maintained to track which elements in the vector are
null. A viewBuffer keeps track of all values in the vector, and an external data buffer is kept
to keep longer strings (>12).
-
Field Summary
Fields inherited from class org.apache.arrow.vector.BaseVariableWidthViewVector
BUF_INDEX_WIDTH, dataBuffers, ELEMENT_SIZE, EMPTY_BYTE_ARRAY, field, INITIAL_VIEW_VALUE_ALLOCATION, initialDataBufferSize, INLINE_SIZE, lastSet, LENGTH_WIDTH, PREFIX_WIDTH, viewBufferFields inherited from class org.apache.arrow.vector.BaseValueVector
allocator, fieldReader, INITIAL_VALUE_ALLOCATION, MAX_ALLOCATION_SIZE, MAX_ALLOCATION_SIZE_PROPERTY, validityBuffer, valueCount -
Constructor Summary
ConstructorsConstructorDescriptionViewVarCharVector(String name, BufferAllocator allocator) Instantiate a ViewVarCharVector.ViewVarCharVector(String name, FieldType fieldType, BufferAllocator allocator) Instantiate a ViewVarCharVector.ViewVarCharVector(Field field, BufferAllocator allocator) Instantiate a ViewVarCharVector. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]get(int index) Get the variable length element at specified index as a byte array.voidget(int index, NullableViewVarCharHolder holder) Get the variable length element at specified index and sets the state in provided holder.Get a minor type for this vector.getObject(int index) Get the variable length element at specified index as Text.protected FieldReaderEach vector has a different reader that implements the FieldReader interface.getTransferPair(String ref, BufferAllocator allocator) Construct a TransferPair comprising this and a target vector of the same type.getTransferPair(Field field, BufferAllocator allocator) Construct a TransferPair with a desired target vector of the same type.Construct a TransferPair with a desired target vector of the same type.voidread(int index, ReusableBuffer<?> buffer) Read the value at the given position to the given output buffer.voidset(int index, NullableViewVarCharHolder holder) Set the variable length element at the specified index to the data buffer supplied in the holder.voidset(int index, ViewVarCharHolder holder) Set the variable length element at the specified index to the data buffer supplied in the holder.voidSet the variable length element at the specified index to the content in supplied Text.voidsetSafe(int index, NullableViewVarCharHolder holder) Same asset(int, NullableViewVarCharHolder)except that it handles the case where index and length of a new element are beyond the existing capacity of the vector.voidsetSafe(int index, ViewVarCharHolder holder) Same asset(int, ViewVarCharHolder)except that it handles the case where index and length of a new element are beyond the existing capacity of the vector.voidSame asset(int, NullableViewVarCharHolder)except that it handles the case where index and length of a new element are beyond the existing capacity of the vector.voidValidate the scalar values held by this vector.Methods inherited from class org.apache.arrow.vector.BaseVariableWidthViewVector
accept, allocateNew, allocateNew, allocateNew, allocateNewSafe, allocateOrGetLastDataBuffer, allocateValidityBuffer, clear, clearDataBuffers, close, copyFrom, copyFromSafe, exportCDataBuffers, fillEmpties, getBuffers, getBufferSize, getBufferSizeFor, getByteCapacity, getChildrenFromFields, getData, getData, getDataBuffer, getDataBufferAddress, getDataBuffers, getDataPointer, getDataPointer, getDensity, getExportedCDataBufferCount, getField, getFieldBuffers, getFieldInnerVectors, getLastSet, getName, getNullCount, getOffsetBuffer, getOffsetBufferAddress, getTotalValueLengthUpToIndex, getTransferPair, getTransferPair, getTransferPair, getValidityBuffer, getValidityBufferAddress, getValueCapacity, getValueCount, getValueLength, handleSafe, hashCode, hashCode, initializeChildrenFromFields, isNull, isSafe, isSet, loadFieldBuffers, reAlloc, reallocValidityBuffer, reallocViewBuffer, reallocViewBuffer, reallocViewDataBuffer, reallocViewDataBuffer, reset, set, set, set, set, set, setBytes, setBytes, setIndexDefined, setInitialCapacity, setInitialCapacity, setLastSet, setNull, setSafe, setSafe, setSafe, setSafe, setSafe, setValueCount, setValueLengthSafe, sizeOfValueBuffer, sizeOfViewBufferElements, sliceAndTransferValidityBuffer, splitAndTransferTo, transferTo, zeroVectorMethods inherited from class org.apache.arrow.vector.BaseValueVector
checkBufRefs, copyValidityBuffer, getAllocator, getReader, getValidityBufferSizeFromCount, iterator, releaseBuffer, splitAndTransferValidityBuffer, toString, transferBufferMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.arrow.vector.FieldVector
exportBufferMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface org.apache.arrow.vector.ValueIterableVector
getValueIterable, getValueIteratorMethods inherited from interface org.apache.arrow.vector.ValueVector
accept, allocateNew, allocateNewSafe, clear, close, copyFrom, copyFromSafe, getAllocator, getBuffers, getBufferSize, getBufferSizeFor, getDataBuffer, getField, getName, getNullCount, getOffsetBuffer, getReader, getTransferPair, getTransferPair, getTransferPair, getValidityBuffer, getValueCapacity, getValueCount, hashCode, hashCode, isNull, reAlloc, reset, setInitialCapacity, setValueCount, validate, validateFull
-
Constructor Details
-
ViewVarCharVector
Instantiate a ViewVarCharVector. This doesn't allocate any memory for the data in vector.- Parameters:
name- name of the vectorallocator- allocator for memory management.
-
ViewVarCharVector
Instantiate a ViewVarCharVector. This doesn't allocate any memory for the data in vector.- Parameters:
name- name of the vectorfieldType- type of Field materialized by this vectorallocator- allocator for memory management.
-
ViewVarCharVector
Instantiate a ViewVarCharVector. This doesn't allocate any memory for the data in vector.- Parameters:
field- field materialized by this vectorallocator- allocator for memory management.
-
-
Method Details
-
getReaderImpl
Description copied from class:BaseValueVectorEach vector has a different reader that implements the FieldReader interface. Overridden methods must make sure to return the correct concrete reader implementation.- Specified by:
getReaderImplin classBaseValueVector- Returns:
- Returns a lambda that initializes a reader when called.
-
getMinorType
Get a minor type for this vector. The vector holds values belonging to a particular type.- Specified by:
getMinorTypein interfaceValueVector- Returns:
Types.MinorType
-
get
public byte[] get(int index) Get the variable length element at specified index as a byte array.- Specified by:
getin interfaceVariableWidthFieldVector- Parameters:
index- position of an element to get- Returns:
- array of bytes for a non-null element, null otherwise
-
getObject
Get the variable length element at specified index as Text.- Specified by:
getObjectin interfaceValueVector- Parameters:
index- position of an element to get- Returns:
- Text object for a non-null element, null otherwise
-
read
Read the value at the given position to the given output buffer. The caller is responsible for checking for nullity first.- Specified by:
readin interfaceVariableWidthFieldVector- Parameters:
index- position of an element.buffer- the buffer to write into.
-
get
Get the variable length element at specified index and sets the state in provided holder.- Parameters:
index- position of an element to getholder- data holder to be populated by this function
-
set
Set the variable length element at the specified index to the data buffer supplied in the holder.- Parameters:
index- position of the element to setholder- holder that carries data buffer.
-
setSafe
Same asset(int, ViewVarCharHolder)except that 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 setholder- holder that carries data buffer.
-
set
Set the variable length element at the specified index to the data buffer supplied in the holder.- Parameters:
index- position of the element to setholder- holder that carries data buffer.
-
setSafe
Same asset(int, NullableViewVarCharHolder)except that 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 setholder- holder that carries data buffer.
-
set
Set the variable length element at the specified index to the content in supplied Text.- Parameters:
index- position of the element to settext- Text object with data
-
setSafe
Same asset(int, NullableViewVarCharHolder)except that 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 set.text- Text object with data
-
validateScalars
public void validateScalars()Description copied from class:BaseVariableWidthViewVectorValidate the scalar values held by this vector.- Overrides:
validateScalarsin classBaseVariableWidthViewVector
-
getTransferPair
Construct a TransferPair comprising this and a target vector of the same type.- Specified by:
getTransferPairin interfaceValueVector- Specified by:
getTransferPairin classBaseVariableWidthViewVector- Parameters:
ref- name of the target vectorallocator- allocator for the target vector- Returns:
TransferPair(UnsupportedOperationException)
-
getTransferPair
Construct a TransferPair with a desired target vector of the same type.- Specified by:
getTransferPairin interfaceValueVector- Specified by:
getTransferPairin classBaseVariableWidthViewVector- Parameters:
field- The field materialized by this vector.allocator- allocator for the target vector- Returns:
TransferPair(UnsupportedOperationException)
-
makeTransferPair
Construct a TransferPair with a desired target vector of the same type.- Specified by:
makeTransferPairin interfaceValueVector- Parameters:
to- the target for the transfer- Returns:
TransferPair(UnsupportedOperationException)
-