public abstract class AbstractStructVector extends AbstractContainerVector
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractStructVector.ConflictPolicy
Policy to determine how to react when duplicate columns are encountered.
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allowConflictPolicyChanges |
allocator, callBack, name| Modifier | Constructor and Description |
|---|---|
protected |
AbstractStructVector(String name,
BufferAllocator allocator,
CallBack callBack,
AbstractStructVector.ConflictPolicy conflictPolicy,
boolean allowConflictPolicyChanges)
Base constructor that sets default conflict policy to APPEND.
|
| Modifier and Type | Method and Description |
|---|---|
protected ValueVector |
add(String childName,
FieldType fieldType) |
<T extends FieldVector> |
addOrGet(String childName,
FieldType fieldType,
Class<T> clazz)
Adds a new field with the given parameters or replaces the existing one and consequently returns the resultant
ValueVector. |
boolean |
allocateNewSafe()
Allocates new buffers.
|
void |
close()
Clears out all underlying child vectors.
|
ArrowBuf[] |
getBuffers(boolean clear)
Return the underlying buffers associated with this vector.
|
int |
getBufferSize()
Get the number of bytes used by this vector.
|
<T extends FieldVector> |
getChild(String name,
Class<T> clazz)
Returns a
ValueVector instance of subtype of T corresponding to the given
field name if exists or null. |
ValueVector |
getChildByOrdinal(int id)
Returns a
ValueVector corresponding to the given ordinal identifier. |
List<String> |
getChildFieldNames()
Get child field names.
|
protected List<FieldVector> |
getChildren()
Get child vectors.
|
VectorWithOrdinal |
getChildVectorWithOrdinal(String name)
Get a child vector by name.
|
AbstractStructVector.ConflictPolicy |
getConflictPolicy() |
List<ValueVector> |
getPrimitiveVectors()
Get primitive child vectors.
|
Iterator<ValueVector> |
iterator() |
protected void |
putChild(String name,
FieldVector vector)
Inserts the vector with the given name if it does not exist else replaces it with the new value.
|
protected void |
putVector(String name,
FieldVector vector)
Inserts the input vector into the map if it does not exist.
|
void |
reAlloc()
Allocate new buffer with double capacity, and copy data into the new buffer.
|
AbstractStructVector.ConflictPolicy |
setConflictPolicy(AbstractStructVector.ConflictPolicy conflictPolicy)
Set conflict policy and return last conflict policy state.
|
int |
size()
Get the number of child vectors.
|
String |
toString()
Representation of vector suitable for debugging.
|
addOrGetFixedSizeList, addOrGetList, addOrGetMap, addOrGetStruct, addOrGetUnion, allocateNew, copyFrom, copyFromSafe, getAllocator, getChild, getName, supportsDirectRead, typeifyclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaccept, clear, getBufferSizeFor, getDataBuffer, getField, getMinorType, getNullCount, getObject, getOffsetBuffer, getReader, getTransferPair, getTransferPair, getTransferPair, getTransferPair, getTransferPair, getValidityBuffer, getValueCapacity, getValueCount, hashCode, hashCode, isNull, makeTransferPair, reset, setInitialCapacity, setValueCount, validate, validateFullforEach, spliteratorsetInitialCapacityprotected AbstractStructVector(String name, BufferAllocator allocator, CallBack callBack, AbstractStructVector.ConflictPolicy conflictPolicy, boolean allowConflictPolicyChanges)
public AbstractStructVector.ConflictPolicy setConflictPolicy(AbstractStructVector.ConflictPolicy conflictPolicy)
public AbstractStructVector.ConflictPolicy getConflictPolicy()
public void close()
AbstractContainerVectorclose in interface Closeableclose in interface AutoCloseableclose in interface ValueVectorclose in class AbstractContainerVectorpublic boolean allocateNewSafe()
ValueVectorpublic void reAlloc()
ValueVectorpublic <T extends FieldVector> T addOrGet(String childName, FieldType fieldType, Class<T> clazz)
ValueVector.
Execution takes place in the following order:
IllegalStateException
addOrGet in class AbstractContainerVectorT - class type of expected vector typechildName - the name of the fieldfieldType - the type for the vectorclazz - class of expected vector typeValueVectorIllegalStateException - raised if there is a hard schema changepublic ValueVector getChildByOrdinal(int id)
ValueVector corresponding to the given ordinal identifier.id - the ordinal of the child to returnpublic <T extends FieldVector> T getChild(String name, Class<T> clazz)
ValueVector instance of subtype of T corresponding to the given
field name if exists or null.
If there is more than one element for name this will return the first inserted.getChild in class AbstractContainerVectorname - the name of the child to returnclazz - the expected type of the childprotected ValueVector add(String childName, FieldType fieldType)
protected void putChild(String name, FieldVector vector)
Note that this method does not enforce any vector type check nor throws a schema change exception.
name - the name of the child to addvector - the vector to add as a childprotected void putVector(String name, FieldVector vector)
If the field name already exists the conflict is handled according to the currently set ConflictPolicy
name - field namevector - vector to be insertedprotected List<FieldVector> getChildren()
public int size()
size in class AbstractContainerVectorpublic Iterator<ValueVector> iterator()
public List<ValueVector> getPrimitiveVectors()
public VectorWithOrdinal getChildVectorWithOrdinal(String name)
getChildVectorWithOrdinal in class AbstractContainerVectorname - the name of the child to returnpublic ArrowBuf[] getBuffers(boolean clear)
ValueVectorclear - Whether to clear vector before returning; the buffers will still be refcounted;
but the returned array will be the only reference to thembuffers that is used by this vector instance.public int getBufferSize()
ValueVectorpublic String toString()
AbstractContainerVectortoString in class AbstractContainerVectorCopyright © 2024 The Apache Software Foundation. All rights reserved.