public final class Data extends Object
This API is EXPERIMENTAL. Note that currently only 64bit systems are supported.
Modifier and Type | Method and Description |
---|---|
static void |
exportArrayStream(BufferAllocator allocator,
ArrowReader reader,
ArrowArrayStream out)
Export a reader as an ArrowArrayStream using the C Stream Interface.
|
static void |
exportField(BufferAllocator allocator,
Field field,
DictionaryProvider provider,
ArrowSchema out)
Export Java Field using the C data interface format.
|
static void |
exportSchema(BufferAllocator allocator,
Schema schema,
DictionaryProvider provider,
ArrowSchema out)
Export Java Schema using the C data interface format.
|
static void |
exportTable(BufferAllocator allocator,
Table table,
ArrowArray out)
Export the current contents of a Java Table using the C data
interface format.
|
static void |
exportTable(BufferAllocator allocator,
Table table,
DictionaryProvider provider,
ArrowArray out)
Export the current contents of a Java Table using the C data
interface format.
|
static void |
exportTable(BufferAllocator allocator,
Table table,
DictionaryProvider provider,
ArrowArray out,
ArrowSchema outSchema)
Export the current contents of a Java Table using the C data interface format.
|
static void |
exportVector(BufferAllocator allocator,
FieldVector vector,
DictionaryProvider provider,
ArrowArray out)
Export Java FieldVector using the C data interface format.
|
static void |
exportVector(BufferAllocator allocator,
FieldVector vector,
DictionaryProvider provider,
ArrowArray out,
ArrowSchema outSchema)
Export Java FieldVector using the C data interface format.
|
static void |
exportVectorSchemaRoot(BufferAllocator allocator,
VectorSchemaRoot vsr,
DictionaryProvider provider,
ArrowArray out)
Export the current contents of a Java VectorSchemaRoot using the C data
interface format.
|
static void |
exportVectorSchemaRoot(BufferAllocator allocator,
VectorSchemaRoot vsr,
DictionaryProvider provider,
ArrowArray out,
ArrowSchema outSchema)
Export the current contents of a Java VectorSchemaRoot using the C data
interface format.
|
static ArrowReader |
importArrayStream(BufferAllocator allocator,
ArrowArrayStream stream)
Import an ArrowArrayStream as an
ArrowReader . |
static Field |
importField(BufferAllocator allocator,
ArrowSchema schema,
CDataDictionaryProvider provider)
Import Java Field from the C data interface.
|
static void |
importIntoVector(BufferAllocator allocator,
ArrowArray array,
FieldVector vector,
DictionaryProvider provider)
Import Java vector from the C data interface.
|
static void |
importIntoVectorSchemaRoot(BufferAllocator allocator,
ArrowArray array,
VectorSchemaRoot root,
DictionaryProvider provider)
Import record batch from the C data interface into vector schema root.
|
static Schema |
importSchema(BufferAllocator allocator,
ArrowSchema schema,
CDataDictionaryProvider provider)
Import Java Schema from the C data interface.
|
static FieldVector |
importVector(BufferAllocator allocator,
ArrowArray array,
ArrowSchema schema,
CDataDictionaryProvider provider)
Import Java vector and its type from the C data interface.
|
static VectorSchemaRoot |
importVectorSchemaRoot(BufferAllocator allocator,
ArrowArray array,
ArrowSchema schema,
CDataDictionaryProvider provider)
Import Java vector schema root from the C data interface.
|
static VectorSchemaRoot |
importVectorSchemaRoot(BufferAllocator allocator,
ArrowSchema schema,
CDataDictionaryProvider provider)
Import Java vector schema root from a C data interface Schema.
|
public static void exportField(BufferAllocator allocator, Field field, DictionaryProvider provider, ArrowSchema out)
allocator
- Buffer allocator for allocating C data interface fieldsfield
- Field object to exportprovider
- Dictionary provider for dictionary encoded fields (optional)out
- C struct where to export the fieldpublic static void exportSchema(BufferAllocator allocator, Schema schema, DictionaryProvider provider, ArrowSchema out)
allocator
- Buffer allocator for allocating C data interface fieldsschema
- Schema object to exportprovider
- Dictionary provider for dictionary encoded fields (optional)out
- C struct where to export the fieldpublic static void exportVector(BufferAllocator allocator, FieldVector vector, DictionaryProvider provider, ArrowArray out)
The resulting ArrowArray struct keeps the array data and buffers alive until its release callback is called by the consumer.
allocator
- Buffer allocator for allocating C data interface fieldsvector
- Vector object to exportprovider
- Dictionary provider for dictionary encoded vectors
(optional)out
- C struct where to export the arraypublic static void exportVector(BufferAllocator allocator, FieldVector vector, DictionaryProvider provider, ArrowArray out, ArrowSchema outSchema)
The resulting ArrowArray struct keeps the array data and buffers alive until its release callback is called by the consumer.
allocator
- Buffer allocator for allocating C data interface fieldsvector
- Vector object to exportprovider
- Dictionary provider for dictionary encoded vectors
(optional)out
- C struct where to export the arrayoutSchema
- C struct where to export the array type (optional)public static void exportTable(BufferAllocator allocator, Table table, ArrowArray out)
The table is exported as if it were a struct array. The resulting ArrowArray struct keeps the record batch data and buffers alive until its release callback is called by the consumer.
allocator
- Buffer allocator for allocating C data interface fieldstable
- Table to exportout
- C struct where to export the record batchpublic static void exportTable(BufferAllocator allocator, Table table, DictionaryProvider provider, ArrowArray out)
The table is exported as if it were a struct array. The resulting ArrowArray struct keeps the record batch data and buffers alive until its release callback is called by the consumer.
allocator
- Buffer allocator for allocating C data interface fieldstable
- Table to exportprovider
- Dictionary provider for dictionary encoded vectors
(optional)out
- C struct where to export the record batchpublic static void exportTable(BufferAllocator allocator, Table table, DictionaryProvider provider, ArrowArray out, ArrowSchema outSchema)
The table is exported as if it were a struct array. The resulting ArrowArray struct keeps the record batch data and buffers alive until its release callback is called by the consumer.
allocator
- Buffer allocator for allocating C data interface fieldstable
- Table to exportprovider
- Dictionary provider for dictionary encoded vectors
(optional)out
- C struct where to export the record batchoutSchema
- C struct where to export the record batch schema (optional)public static void exportVectorSchemaRoot(BufferAllocator allocator, VectorSchemaRoot vsr, DictionaryProvider provider, ArrowArray out)
The vector schema root is exported as if it were a struct array. The resulting ArrowArray struct keeps the record batch data and buffers alive until its release callback is called by the consumer.
allocator
- Buffer allocator for allocating C data interface fieldsvsr
- Vector schema root to exportprovider
- Dictionary provider for dictionary encoded vectors
(optional)out
- C struct where to export the record batchpublic static void exportVectorSchemaRoot(BufferAllocator allocator, VectorSchemaRoot vsr, DictionaryProvider provider, ArrowArray out, ArrowSchema outSchema)
The vector schema root is exported as if it were a struct array. The resulting ArrowArray struct keeps the record batch data and buffers alive until its release callback is called by the consumer.
allocator
- Buffer allocator for allocating C data interface fieldsvsr
- Vector schema root to exportprovider
- Dictionary provider for dictionary encoded vectors
(optional)out
- C struct where to export the record batchoutSchema
- C struct where to export the record batch schema (optional)public static void exportArrayStream(BufferAllocator allocator, ArrowReader reader, ArrowArrayStream out)
allocator
- Buffer allocator for allocating C data interface fieldsreader
- Reader to exportout
- C struct to export the streampublic static Field importField(BufferAllocator allocator, ArrowSchema schema, CDataDictionaryProvider provider)
The given ArrowSchema struct is released (as per the C data interface specification), even if this function fails.
allocator
- Buffer allocator for allocating dictionary vectorsschema
- C data interface struct representing the field [inout]provider
- A dictionary provider will be initialized with empty
dictionary vectors (optional)public static Schema importSchema(BufferAllocator allocator, ArrowSchema schema, CDataDictionaryProvider provider)
The given ArrowSchema struct is released (as per the C data interface specification), even if this function fails.
allocator
- Buffer allocator for allocating dictionary vectorsschema
- C data interface struct representing the fieldprovider
- A dictionary provider will be initialized with empty
dictionary vectors (optional)public static void importIntoVector(BufferAllocator allocator, ArrowArray array, FieldVector vector, DictionaryProvider provider)
The ArrowArray struct has its contents moved (as per the C data interface specification) to a private object held alive by the resulting array.
allocator
- Buffer allocatorarray
- C data interface struct holding the array datavector
- Imported vector object [out]provider
- Dictionary provider to load dictionary vectors to (optional)public static FieldVector importVector(BufferAllocator allocator, ArrowArray array, ArrowSchema schema, CDataDictionaryProvider provider)
The ArrowArray struct has its contents moved (as per the C data interface specification) to a private object held alive by the resulting vector. The ArrowSchema struct is released, even if this function fails.
allocator
- Buffer allocator for allocating the output FieldVectorarray
- C data interface struct holding the array dataschema
- C data interface struct holding the array typeprovider
- Dictionary provider to load dictionary vectors to (optional)public static void importIntoVectorSchemaRoot(BufferAllocator allocator, ArrowArray array, VectorSchemaRoot root, DictionaryProvider provider)
allocator
- Buffer allocatorarray
- C data interface struct holding the record batch dataroot
- vector schema root to load intoprovider
- Dictionary provider to load dictionary vectors to (optional)public static VectorSchemaRoot importVectorSchemaRoot(BufferAllocator allocator, ArrowSchema schema, CDataDictionaryProvider provider)
allocator
- Buffer allocator for allocating the output VectorSchemaRootschema
- C data interface struct holding the record batch schemaprovider
- Dictionary provider to load dictionary vectors to (optional)public static VectorSchemaRoot importVectorSchemaRoot(BufferAllocator allocator, ArrowArray array, ArrowSchema schema, CDataDictionaryProvider provider)
importIntoVectorSchemaRoot(org.apache.arrow.memory.BufferAllocator, org.apache.arrow.c.ArrowArray, org.apache.arrow.vector.VectorSchemaRoot, org.apache.arrow.vector.dictionary.DictionaryProvider)
for loading array data while
reusing the same vector schema root.allocator
- Buffer allocator for allocating the output VectorSchemaRootarray
- C data interface struct holding the record batch data
(optional)schema
- C data interface struct holding the record batch schemaprovider
- Dictionary provider to load dictionary vectors to (optional)public static ArrowReader importArrayStream(BufferAllocator allocator, ArrowArrayStream stream)
ArrowReader
.allocator
- Buffer allocator for allocating the output data.stream
- C stream interface struct to import.Copyright © 2024 The Apache Software Foundation. All rights reserved.