java.lang.Object
org.apache.arrow.vector.BaseValueVector
org.apache.arrow.vector.complex.BaseRepeatedValueVector
org.apache.arrow.vector.complex.ListVector
org.apache.arrow.vector.complex.MapVector
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<ValueVector>
,BaseListVector
,PromotableVector
,RepeatedValueVector
,DensityAwareVector
,FieldVector
,ValueIterableVector<List<?>>
,ValueVector
A MapVector is used to store entries of key/value pairs. It is a container vector that is
composed of a list of struct values with "key" and "value" fields. The MapVector is nullable, but
if a map is set at a given index, there must be an entry. In other words, the StructVector data
is non-nullable. Also for a given entry, the "key" is non-nullable, however the "value" can be
null.
-
Field Summary
Fields inherited from class org.apache.arrow.vector.complex.ListVector
field, lastSet, reader, validityAllocationSizeInBytes, validityBuffer
Fields inherited from class org.apache.arrow.vector.complex.BaseRepeatedValueVector
DEFAULT_DATA_VECTOR, defaultDataVectorName, OFFSET_WIDTH, offsetAllocationSizeInBytes, offsetBuffer, repeatedCallBack, valueCount, vector
Fields inherited from class org.apache.arrow.vector.BaseValueVector
allocator, fieldReader, INITIAL_VALUE_ALLOCATION, MAX_ALLOCATION_SIZE, MAX_ALLOCATION_SIZE_PROPERTY
Fields inherited from interface org.apache.arrow.vector.complex.RepeatedValueVector
DEFAULT_REPEAT_PER_RECORD
-
Constructor Summary
ConstructorDescriptionMapVector
(String name, BufferAllocator allocator, FieldType fieldType, CallBack callBack) Construct a MapVector instance.MapVector
(Field field, BufferAllocator allocator, CallBack callBack) -
Method Summary
Modifier and TypeMethodDescriptionstatic MapVector
empty
(String name, BufferAllocator allocator, boolean keysSorted) Construct an empty MapVector with no data.Get the reader for this MapVector instance.getTransferPair
(String ref, BufferAllocator allocator) To transfer quota responsibility.getTransferPair
(String ref, BufferAllocator allocator, CallBack callBack) To transfer quota responsibility.getTransferPair
(Field field, BufferAllocator allocator) To transfer quota responsibility.getTransferPair
(Field field, BufferAllocator allocator, CallBack callBack) To transfer quota responsibility.Get the writer for this MapVector instance.void
initializeChildrenFromFields
(List<Field> children) Initialize child vectors of the map from the given list of fields.makeTransferPair
(ValueVector target) Makes a new transfer pair used to transfer underlying buffers.Methods inherited from class org.apache.arrow.vector.complex.ListVector
accept, addOrGetVector, allocateNew, allocateNewSafe, allocateValidityBuffer, clear, copyFrom, copyFromSafe, empty, endValue, exportCDataBuffers, getBuffers, getBufferSize, getBufferSizeFor, getChildrenFromFields, getDataBuffer, getDataBufferAddress, getDataVector, getDensity, getElementEndIndex, getElementStartIndex, getField, getFieldBuffers, getFieldInnerVectors, getLastSet, getNullCount, getObject, getOffsetBuffer, getOffsetBufferAddress, getReaderImpl, getValidityBuffer, getValidityBufferAddress, getValueCapacity, hashCode, hashCode, invalidateReader, isEmpty, isNull, isSet, loadFieldBuffers, promoteToUnion, reAlloc, reallocValidityAndOffsetBuffers, reset, setInitialCapacity, setInitialCapacity, setInitialTotalCapacity, setLastSet, setNotNull, setNull, setValueCount, startNewValue
Methods inherited from class org.apache.arrow.vector.complex.BaseRepeatedValueVector
allocateOffsetBuffer, getInnerValueCount, getInnerValueCountAt, getName, getOffsetBufferValueCapacity, getOffsetVector, getValueCount, iterator, reallocOffsetBuffer, replaceDataVector, size
Methods inherited from class org.apache.arrow.vector.BaseValueVector
checkBufRefs, close, getAllocator, getTransferPair, getValidityBufferSizeFromCount, releaseBuffer, toString, transferBuffer
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.arrow.vector.FieldVector
exportBuffer, getExportedCDataBufferCount
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface org.apache.arrow.vector.ValueIterableVector
getValueIterable, getValueIterator
Methods inherited from interface org.apache.arrow.vector.ValueVector
close, getAllocator, getName, getTransferPair, getValueCount, validate, validateFull
-
Field Details
-
KEY_NAME
- See Also:
-
VALUE_NAME
- See Also:
-
DATA_VECTOR_NAME
- See Also:
-
-
Constructor Details
-
MapVector
Construct a MapVector instance.- Parameters:
name
- The name of the vector.allocator
- The allocator used for allocating/reallocating buffers.fieldType
- The type definition of the MapVector.callBack
- A schema change callback.
-
MapVector
-
-
Method Details
-
empty
Construct an empty MapVector with no data. Child vectors must be added subsequently.- Parameters:
name
- The name of the vector.allocator
- The allocator used for allocating/reallocating buffers.keysSorted
- True if the map keys have been pre-sorted.- Returns:
- a new instance of MapVector.
-
initializeChildrenFromFields
Initialize child vectors of the map from the given list of fields.- Specified by:
initializeChildrenFromFields
in interfaceFieldVector
- Overrides:
initializeChildrenFromFields
in classListVector
- Parameters:
children
- List of fields that will be children of this MapVector.
-
getWriter
Get the writer for this MapVector instance.- Overrides:
getWriter
in classListVector
-
getReader
Get the reader for this MapVector instance.- Specified by:
getReader
in interfaceValueVector
- Overrides:
getReader
in classListVector
- Returns:
- Concrete instance of FieldReader by using double-checked locking.
-
getMinorType
- Specified by:
getMinorType
in interfaceValueVector
- Overrides:
getMinorType
in classListVector
-
getTransferPair
Description copied from interface:ValueVector
To transfer quota responsibility.- Specified by:
getTransferPair
in interfaceValueVector
- Overrides:
getTransferPair
in classListVector
- Parameters:
ref
- the name of the vectorallocator
- the target allocator- Returns:
- a
transfer pair
, creating a new target vector of the same type.
-
getTransferPair
Description copied from interface:ValueVector
To transfer quota responsibility.- Specified by:
getTransferPair
in interfaceValueVector
- Overrides:
getTransferPair
in classListVector
- Parameters:
field
- the Field object used by the target vectorallocator
- the target allocator- Returns:
- a
transfer pair
, creating a new target vector of the same type.
-
getTransferPair
Description copied from interface:ValueVector
To transfer quota responsibility.- Specified by:
getTransferPair
in interfaceValueVector
- Overrides:
getTransferPair
in classListVector
- Parameters:
ref
- the name of the vectorallocator
- the target allocatorcallBack
- A schema change callback.- Returns:
- a
transfer pair
, creating a new target vector of the same type.
-
getTransferPair
Description copied from interface:ValueVector
To transfer quota responsibility.- Specified by:
getTransferPair
in interfaceValueVector
- Overrides:
getTransferPair
in classListVector
- Parameters:
field
- the Field object used by the target vectorallocator
- the target allocatorcallBack
- A schema change callback.- Returns:
- a
transfer pair
, creating a new target vector of the same type.
-
makeTransferPair
Description copied from interface:ValueVector
Makes a new transfer pair used to transfer underlying buffers.- Specified by:
makeTransferPair
in interfaceValueVector
- Overrides:
makeTransferPair
in classListVector
- Parameters:
target
- the target for the transfer- Returns:
- a new
transfer pair
that is used to transfer underlying buffers into the target vector.
-