Package org.apache.arrow.vector.complex
Class MapVector
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
FieldsFields inherited from class org.apache.arrow.vector.complex.ListVector
field, lastSet, reader, validityAllocationSizeInBytes, validityBufferFields inherited from class org.apache.arrow.vector.complex.BaseRepeatedValueVector
DEFAULT_DATA_VECTOR, defaultDataVectorName, OFFSET_WIDTH, offsetAllocationSizeInBytes, offsetBuffer, repeatedCallBack, valueCount, vectorFields inherited from class org.apache.arrow.vector.BaseValueVector
allocator, fieldReader, INITIAL_VALUE_ALLOCATION, MAX_ALLOCATION_SIZE, MAX_ALLOCATION_SIZE_PROPERTYFields inherited from interface org.apache.arrow.vector.complex.RepeatedValueVector
DEFAULT_REPEAT_PER_RECORD -
Constructor Summary
ConstructorsConstructorDescriptionMapVector(String name, BufferAllocator allocator, FieldType fieldType, CallBack callBack) Construct a MapVector instance.MapVector(Field field, BufferAllocator allocator, CallBack callBack) -
Method Summary
Modifier and TypeMethodDescriptionstatic MapVectorempty(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.voidinitializeChildrenFromFields(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, startNewValueMethods inherited from class org.apache.arrow.vector.complex.BaseRepeatedValueVector
allocateOffsetBuffer, getInnerValueCount, getInnerValueCountAt, getName, getOffsetBufferValueCapacity, getOffsetVector, getValueCount, iterator, reallocOffsetBuffer, replaceDataVector, sizeMethods inherited from class org.apache.arrow.vector.BaseValueVector
checkBufRefs, close, getAllocator, getTransferPair, getValidityBufferSizeFromCount, releaseBuffer, 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
exportBuffer, getExportedCDataBufferCountMethods 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
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:
initializeChildrenFromFieldsin interfaceFieldVector- Overrides:
initializeChildrenFromFieldsin classListVector- Parameters:
children- List of fields that will be children of this MapVector.
-
getWriter
Get the writer for this MapVector instance.- Overrides:
getWriterin classListVector
-
getReader
Get the reader for this MapVector instance.- Specified by:
getReaderin interfaceValueVector- Overrides:
getReaderin classListVector- Returns:
- Concrete instance of FieldReader by using double-checked locking.
-
getMinorType
- Specified by:
getMinorTypein interfaceValueVector- Overrides:
getMinorTypein classListVector
-
getTransferPair
Description copied from interface:ValueVectorTo transfer quota responsibility.- Specified by:
getTransferPairin interfaceValueVector- Overrides:
getTransferPairin 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:ValueVectorTo transfer quota responsibility.- Specified by:
getTransferPairin interfaceValueVector- Overrides:
getTransferPairin 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:ValueVectorTo transfer quota responsibility.- Specified by:
getTransferPairin interfaceValueVector- Overrides:
getTransferPairin 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:ValueVectorTo transfer quota responsibility.- Specified by:
getTransferPairin interfaceValueVector- Overrides:
getTransferPairin 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:ValueVectorMakes a new transfer pair used to transfer underlying buffers.- Specified by:
makeTransferPairin interfaceValueVector- Overrides:
makeTransferPairin classListVector- Parameters:
target- the target for the transfer- Returns:
- a new
transfer pairthat is used to transfer underlying buffers into the target vector.
-