Package org.apache.drill.exec.vector
Class RepeatedVarCharVector
java.lang.Object
org.apache.drill.exec.vector.BaseValueVector
org.apache.drill.exec.vector.complex.BaseRepeatedValueVector
org.apache.drill.exec.vector.RepeatedVarCharVector
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<ValueVector>
,ContainerVectorLike
,RepeatedValueVector
,RepeatedVariableWidthVectorLike
,ValueVector
public final class RepeatedVarCharVector
extends BaseRepeatedValueVector
implements RepeatedVariableWidthVectorLike
RepeatedVarChar implements a vector with multiple values per row (e.g. JSON array or
repeated protobuf field). The implementation uses an additional value vectors to convert
the index offset to the underlying element offset. The count of values comes from subtracting
two successive offsets.
NB: this class is automatically generated from RepeatedValueVectors.java and ValueVectorTypes.tdd using FreeMarker.
-
Nested Class Summary
Modifier and TypeClassDescriptionfinal class
final class
Nested classes/interfaces inherited from class org.apache.drill.exec.vector.complex.BaseRepeatedValueVector
BaseRepeatedValueVector.BaseRepeatedAccessor, BaseRepeatedValueVector.BaseRepeatedMutator, BaseRepeatedValueVector.BaseRepeatedValueVectorTransferPair<T extends BaseRepeatedValueVector>
Nested classes/interfaces inherited from class org.apache.drill.exec.vector.BaseValueVector
BaseValueVector.BaseAccessor, BaseValueVector.BaseMutator
Nested classes/interfaces inherited from interface org.apache.drill.exec.vector.complex.RepeatedValueVector
RepeatedValueVector.RepeatedAccessor, RepeatedValueVector.RepeatedMutator
-
Field Summary
Fields inherited from class org.apache.drill.exec.vector.complex.BaseRepeatedValueVector
DATA_VECTOR_NAME, DEFAULT_DATA_VECTOR, offsets, OFFSETS_FIELD, OFFSETS_VECTOR_NAME, vector
Fields inherited from class org.apache.drill.exec.vector.BaseValueVector
allocator, field, INITIAL_VALUE_ALLOCATION, MAX_ALLOCATION_SIZE
Fields inherited from interface org.apache.drill.exec.vector.complex.RepeatedValueVector
DEFAULT_REPEAT_PER_RECORD
Fields inherited from interface org.apache.drill.exec.vector.ValueVector
BITS_VECTOR_NAME, MAX_BUFFER_SIZE, MAX_ROW_COUNT, MIN_ROW_COUNT, VALUES_VECTOR_NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddOrGetVector
(VectorDescriptor descriptor) Creates and adds a child vector if none with the same name exists, else returns the vector instance.void
Allocate new buffers.void
allocateNew
(int totalBytes, int valueCount, int innerValueCount) Allocate a new memory space for this vector.boolean
Allocates new buffers.void
copyEntry
(int toIndex, ValueVector from, int fromIndex) void
copyFrom
(int inIndex, int outIndex, RepeatedVarCharVector v) void
copyFromSafe
(int inIndex, int outIndex, RepeatedVarCharVector v) Returns anaccessor
that is used to read from this vector instance.int
Provide the maximum amount of variable width bytes that can be stored int his vector.protected UserBitShared.SerializedField.Builder
Returns anmutator
that is used to write to this vector instance.Returns afield reader
that supports reading values from this vector.getTransferPair
(String ref, BufferAllocator allocator) getTransferPair
(BufferAllocator allocator) Returns atransfer pair
, creating a new target vector of the same type.Returns a newtransfer pair
that is used to transfer underlying buffers into the target vector.void
splitAndTransferTo
(int startIndex, int groups, RepeatedVarCharVector to) void
transferTo
(RepeatedVarCharVector target) Methods inherited from class org.apache.drill.exec.vector.complex.BaseRepeatedValueVector
clear, collectLedgers, exchange, getAllocatedSize, getBuffers, getBufferSize, getBufferSizeFor, getOffsetVector, getPayloadByteCount, getValueCapacity, iterator, load, replaceDataVector, setChildVector, setInitialCapacity, size
Methods inherited from class org.apache.drill.exec.vector.BaseValueVector
checkBufRefs, close, fillBitsVector, getAllocator, getField, getField, getMetadata, toNullable, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.apache.drill.exec.vector.ValueVector
close, getAllocator, getField, getMetadata, toNullable
-
Constructor Details
-
RepeatedVarCharVector
-
-
Method Details
-
getMutator
Description copied from interface:ValueVector
Returns anmutator
that is used to write to this vector instance.- Specified by:
getMutator
in interfaceRepeatedValueVector
- Specified by:
getMutator
in interfaceValueVector
-
getAccessor
Description copied from interface:ValueVector
Returns anaccessor
that is used to read from this vector instance.- Specified by:
getAccessor
in interfaceRepeatedValueVector
- Specified by:
getAccessor
in interfaceValueVector
-
getReader
Description copied from interface:ValueVector
Returns afield reader
that supports reading values from this vector.- Specified by:
getReader
in interfaceValueVector
-
getDataVector
- Specified by:
getDataVector
in interfaceRepeatedValueVector
- Overrides:
getDataVector
in classBaseRepeatedValueVector
- Returns:
- the underlying data vector or null if none exists.
-
getTransferPair
Description copied from interface:ValueVector
Returns atransfer pair
, creating a new target vector of the same type.- Specified by:
getTransferPair
in interfaceValueVector
- Overrides:
getTransferPair
in classBaseValueVector
-
getTransferPair
- Specified by:
getTransferPair
in interfaceValueVector
-
makeTransferPair
Description copied from interface:ValueVector
Returns a newtransfer pair
that is used to transfer underlying buffers into the target vector.- Specified by:
makeTransferPair
in interfaceValueVector
-
addOrGetVector
Description copied from interface:ContainerVectorLike
Creates and adds a child vector if none with the same name exists, else returns the vector instance.- Specified by:
addOrGetVector
in interfaceContainerVectorLike
- Overrides:
addOrGetVector
in classBaseRepeatedValueVector
- Parameters:
descriptor
- vector descriptor- Returns:
- result of operation wrapping vector corresponding to the given descriptor and whether it's newly created
-
transferTo
-
splitAndTransferTo
-
copyFrom
-
copyFromSafe
-
copyEntry
- Specified by:
copyEntry
in interfaceValueVector
-
allocateNewSafe
public boolean allocateNewSafe()Description copied from interface:ValueVector
Allocates new buffers. ValueVector implements logic to determine how much to allocate.- Specified by:
allocateNewSafe
in interfaceValueVector
- Overrides:
allocateNewSafe
in classBaseRepeatedValueVector
- Returns:
- Returns true if allocation was successful.
-
allocateNew
public void allocateNew()Description copied from interface:ValueVector
Allocate new buffers. ValueVector implements logic to determine how much to allocate.- Specified by:
allocateNew
in interfaceValueVector
-
getMetadataBuilder
- Overrides:
getMetadataBuilder
in classBaseRepeatedValueVector
-
allocateNew
public void allocateNew(int totalBytes, int valueCount, int innerValueCount) Description copied from interface:RepeatedVariableWidthVectorLike
Allocate a new memory space for this vector. Must be called prior to using the ValueVector.- Specified by:
allocateNew
in interfaceRepeatedVariableWidthVectorLike
- Parameters:
totalBytes
- Desired size of the underlying data buffer.valueCount
- Number of separate repeating groupings.innerValueCount
- Number of supported values in the vector.
-
getByteCapacity
public int getByteCapacity()Description copied from interface:RepeatedVariableWidthVectorLike
Provide the maximum amount of variable width bytes that can be stored int his vector.- Specified by:
getByteCapacity
in interfaceRepeatedVariableWidthVectorLike
- Returns:
-