Class ArrowUtils
- java.lang.Object
-
- org.apache.flink.table.runtime.arrow.ArrowUtils
-
@Internal public final class ArrowUtils extends Object
Utilities for Arrow.
-
-
Constructor Summary
Constructors Constructor Description ArrowUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkArrowUsable()
static org.apache.flink.table.runtime.arrow.ArrowUtils.CustomIterator<byte[]>
collectAsPandasDataFrame(org.apache.flink.table.api.Table table, int maxArrowBatchSize)
Convert Flink table to Pandas DataFrame.static ArrowReader
createArrowReader(org.apache.arrow.vector.VectorSchemaRoot root, org.apache.flink.table.types.logical.RowType rowType)
Creates anArrowReader
for the specifiedVectorSchemaRoot
.static org.apache.flink.table.api.TableDescriptor
createArrowTableSourceDesc(org.apache.flink.table.types.DataType dataType, String fileName)
static org.apache.flink.table.data.columnar.vector.ColumnVector
createColumnVector(org.apache.arrow.vector.ValueVector vector, org.apache.flink.table.types.logical.LogicalType fieldType)
static ArrowWriter<org.apache.flink.table.data.RowData>
createRowDataArrowWriter(org.apache.arrow.vector.VectorSchemaRoot root, org.apache.flink.table.types.logical.RowType rowType)
Creates anArrowWriter
for the specifiedVectorSchemaRoot
.static org.apache.arrow.memory.RootAllocator
getRootAllocator()
static byte[][]
readArrowBatches(String fileName)
static byte[][]
readArrowBatches(ReadableByteChannel channel)
static org.apache.arrow.vector.types.pojo.Schema
toArrowSchema(org.apache.flink.table.types.logical.RowType rowType)
Returns the Arrow schema of the specified type.
-
-
-
Method Detail
-
getRootAllocator
public static org.apache.arrow.memory.RootAllocator getRootAllocator()
-
checkArrowUsable
public static void checkArrowUsable()
-
toArrowSchema
public static org.apache.arrow.vector.types.pojo.Schema toArrowSchema(org.apache.flink.table.types.logical.RowType rowType)
Returns the Arrow schema of the specified type.
-
createRowDataArrowWriter
public static ArrowWriter<org.apache.flink.table.data.RowData> createRowDataArrowWriter(org.apache.arrow.vector.VectorSchemaRoot root, org.apache.flink.table.types.logical.RowType rowType)
Creates anArrowWriter
for the specifiedVectorSchemaRoot
.
-
createArrowReader
public static ArrowReader createArrowReader(org.apache.arrow.vector.VectorSchemaRoot root, org.apache.flink.table.types.logical.RowType rowType)
Creates anArrowReader
for the specifiedVectorSchemaRoot
.
-
createColumnVector
public static org.apache.flink.table.data.columnar.vector.ColumnVector createColumnVector(org.apache.arrow.vector.ValueVector vector, org.apache.flink.table.types.logical.LogicalType fieldType)
-
createArrowTableSourceDesc
public static org.apache.flink.table.api.TableDescriptor createArrowTableSourceDesc(org.apache.flink.table.types.DataType dataType, String fileName)
-
readArrowBatches
public static byte[][] readArrowBatches(String fileName) throws IOException
- Throws:
IOException
-
readArrowBatches
public static byte[][] readArrowBatches(ReadableByteChannel channel) throws IOException
- Throws:
IOException
-
-