Class GenericArrowVectorAccessorFactory<DecimalT,Utf8StringT,ArrayT,ChildVectorT extends java.lang.AutoCloseable>
- java.lang.Object
-
- org.apache.iceberg.arrow.vectorized.GenericArrowVectorAccessorFactory<DecimalT,Utf8StringT,ArrayT,ChildVectorT>
-
- Type Parameters:
DecimalT
- A concrete type that can represent a decimal.Utf8StringT
- A concrete type that can represent a UTF8 string.ArrayT
- A concrete type that can represent an array value in a list vector, e.g. Spark's ColumnarArray.ChildVectorT
- A concrete type that can represent a child vector in a struct, e.g. Spark's ArrowColumnVector.
public class GenericArrowVectorAccessorFactory<DecimalT,Utf8StringT,ArrayT,ChildVectorT extends java.lang.AutoCloseable> extends java.lang.Object
This class is creates typedArrowVectorAccessor
fromVectorHolder
. It provides a generic implementation for following Arrow types:- Decimal type can be deserialized to a type that supports decimal, e.g. BigDecimal or Spark's Decimal.
- UTF8 String type can deserialized to a Java String or Spark's UTF8String.
- List type: the child elements of a list can be deserialized to Spark's ColumnarArray or similar type.
- Struct type: the child elements of a struct can be deserialized to a Spark's ArrowColumnVector or similar type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
GenericArrowVectorAccessorFactory.ArrayFactory<ChildVectorT,ArrayT>
Create an array value of typeArrayT
from arrow vector value.protected static interface
GenericArrowVectorAccessorFactory.DecimalFactory<DecimalT>
Create a decimal value of typeDecimalT
from arrow vector value.protected static interface
GenericArrowVectorAccessorFactory.StringFactory<Utf8StringT>
Create a UTF8 String value of typeUtf8StringT
from arrow vector value.protected static interface
GenericArrowVectorAccessorFactory.StructChildFactory<ChildVectorT>
Create a struct child vector of typeChildVectorT
from arrow vector value.
-
Constructor Summary
Constructors Modifier Constructor Description protected
GenericArrowVectorAccessorFactory(java.util.function.Supplier<GenericArrowVectorAccessorFactory.DecimalFactory<DecimalT>> decimalFactorySupplier, java.util.function.Supplier<GenericArrowVectorAccessorFactory.StringFactory<Utf8StringT>> stringFactorySupplier, java.util.function.Supplier<GenericArrowVectorAccessorFactory.StructChildFactory<ChildVectorT>> structChildFactorySupplier, java.util.function.Supplier<GenericArrowVectorAccessorFactory.ArrayFactory<ChildVectorT,ArrayT>> arrayFactorySupplier)
The constructor is parameterized using the decimal, string, struct and array factories.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArrowVectorAccessor<DecimalT,Utf8StringT,ArrayT,ChildVectorT>
getVectorAccessor(VectorHolder holder)
-
-
-
Constructor Detail
-
GenericArrowVectorAccessorFactory
protected GenericArrowVectorAccessorFactory(java.util.function.Supplier<GenericArrowVectorAccessorFactory.DecimalFactory<DecimalT>> decimalFactorySupplier, java.util.function.Supplier<GenericArrowVectorAccessorFactory.StringFactory<Utf8StringT>> stringFactorySupplier, java.util.function.Supplier<GenericArrowVectorAccessorFactory.StructChildFactory<ChildVectorT>> structChildFactorySupplier, java.util.function.Supplier<GenericArrowVectorAccessorFactory.ArrayFactory<ChildVectorT,ArrayT>> arrayFactorySupplier)
The constructor is parameterized using the decimal, string, struct and array factories. If a specific type is not supported, the factory supplier can raise anUnsupportedOperationException
.
-
-
Method Detail
-
getVectorAccessor
public ArrowVectorAccessor<DecimalT,Utf8StringT,ArrayT,ChildVectorT> getVectorAccessor(VectorHolder holder)
-
-