This API is EXPERIMENTAL. Note that currently only 64bit systems are supported.
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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) Equivalent to callingimportArrayStream(allocator, stream, true)
.static ArrowReader
importArrayStream
(BufferAllocator allocator, ArrowArrayStream stream, boolean closeImportedStructs) Import an ArrowArrayStream as anArrowReader
.static Field
importField
(BufferAllocator allocator, ArrowSchema schema, CDataDictionaryProvider provider) Equivalent to callingimportField(allocator, schema, provider, true)
.static Field
importField
(BufferAllocator allocator, ArrowSchema schema, CDataDictionaryProvider provider, boolean closeImportedStructs) Import Java Field from the C data interface.static void
importIntoVector
(BufferAllocator allocator, ArrowArray array, FieldVector vector, DictionaryProvider provider) Equivalent to callingimportIntoVector(BufferAllocator, ArrowArray, FieldVector, DictionaryProvider, boolean)
importIntoVector(allocator, array, vector, provider, true)}.static void
importIntoVector
(BufferAllocator allocator, ArrowArray array, FieldVector vector, DictionaryProvider provider, boolean closeImportedStructs) Import Java vector from the C data interface.static void
importIntoVectorSchemaRoot
(BufferAllocator allocator, ArrowArray array, VectorSchemaRoot root, DictionaryProvider provider) Equivalent to callingimportIntoVectorSchemaRoot(allocator, array, root, provider, true)
.static void
importIntoVectorSchemaRoot
(BufferAllocator allocator, ArrowArray array, VectorSchemaRoot root, DictionaryProvider provider, boolean closeImportedStructs) Import record batch from the C data interface into vector schema root.static Schema
importSchema
(BufferAllocator allocator, ArrowSchema schema, CDataDictionaryProvider provider) Equivalent to callingimportSchema(allocator, schema, provider, true)
.static Schema
importSchema
(BufferAllocator allocator, ArrowSchema schema, CDataDictionaryProvider provider, boolean closeImportedStructs) Import Java Schema from the C data interface.static FieldVector
importVector
(BufferAllocator allocator, ArrowArray array, ArrowSchema schema, CDataDictionaryProvider provider) Equivalent to callingimportVector(allocator, array, schema, provider, true)
.static FieldVector
importVector
(BufferAllocator allocator, ArrowArray array, ArrowSchema schema, CDataDictionaryProvider provider, boolean closeImportedStructs) Import Java vector and its type from the C data interface.static VectorSchemaRoot
importVectorSchemaRoot
(BufferAllocator allocator, ArrowArray array, ArrowSchema schema, CDataDictionaryProvider provider) Equivalent to callingimportVectorSchemaRoot(allocator, array, schema, provider, true)
.static VectorSchemaRoot
importVectorSchemaRoot
(BufferAllocator allocator, ArrowArray array, ArrowSchema schema, CDataDictionaryProvider provider, boolean closeImportedStructs) Import Java vector schema root from the C data interface.static VectorSchemaRoot
importVectorSchemaRoot
(BufferAllocator allocator, ArrowSchema schema, CDataDictionaryProvider provider) Equivalent to callingimportVectorSchemaRoot(allocator, schema, provider, true)
.static VectorSchemaRoot
importVectorSchemaRoot
(BufferAllocator allocator, ArrowSchema schema, CDataDictionaryProvider provider, boolean closeImportedStructs) Import Java vector schema root from a C data interface Schema.
-
Method Details
-
exportField
public static void exportField(BufferAllocator allocator, Field field, DictionaryProvider provider, ArrowSchema out) Export Java Field using the C data interface format.- Parameters:
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 field
-
exportSchema
public static void exportSchema(BufferAllocator allocator, Schema schema, DictionaryProvider provider, ArrowSchema out) Export Java Schema using the C data interface format.- Parameters:
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 field
-
exportVector
public static void exportVector(BufferAllocator allocator, FieldVector vector, DictionaryProvider provider, ArrowArray out) Export Java FieldVector using the C data interface format.The resulting ArrowArray struct keeps the array data and buffers alive until its release callback is called by the consumer.
- Parameters:
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 array
-
exportVector
public static void exportVector(BufferAllocator allocator, FieldVector vector, DictionaryProvider provider, ArrowArray out, ArrowSchema outSchema) Export Java FieldVector using the C data interface format.The resulting ArrowArray struct keeps the array data and buffers alive until its release callback is called by the consumer.
- Parameters:
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)
-
exportTable
Export the current contents of a Java Table using the C data interface format.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.
- Parameters:
allocator
- Buffer allocator for allocating C data interface fieldstable
- Table to exportout
- C struct where to export the record batch
-
exportTable
public 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.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.
- Parameters:
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 batch
-
exportTable
public 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.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.
- Parameters:
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)
-
exportVectorSchemaRoot
public 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.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.
- Parameters:
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 batch
-
exportVectorSchemaRoot
public 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.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.
- Parameters:
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)
-
exportArrayStream
public static void exportArrayStream(BufferAllocator allocator, ArrowReader reader, ArrowArrayStream out) Export a reader as an ArrowArrayStream using the C Stream Interface.- Parameters:
allocator
- Buffer allocator for allocating C data interface fieldsreader
- Reader to exportout
- C struct to export the stream
-
importField
public static Field importField(BufferAllocator allocator, ArrowSchema schema, CDataDictionaryProvider provider) Equivalent to callingimportField(allocator, schema, provider, true)
.- Parameters:
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)- Returns:
- Imported field object
- See Also:
-
importField
public static Field importField(BufferAllocator allocator, ArrowSchema schema, CDataDictionaryProvider provider, boolean closeImportedStructs) Import Java Field from the C data interface.The given ArrowSchema struct is released (as per the C data interface specification), even if this function fails.
- Parameters:
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)closeImportedStructs
- if true, the ArrowSchema struct will be closed when this method completes.- Returns:
- Imported field object
-
importSchema
public static Schema importSchema(BufferAllocator allocator, ArrowSchema schema, CDataDictionaryProvider provider) Equivalent to callingimportSchema(allocator, schema, provider, true)
.- Parameters:
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)- Returns:
- Imported schema object
- See Also:
-
importSchema
public static Schema importSchema(BufferAllocator allocator, ArrowSchema schema, CDataDictionaryProvider provider, boolean closeImportedStructs) Import Java Schema from the C data interface.The given ArrowSchema struct is released (as per the C data interface specification), even if this function fails.
- Parameters:
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)closeImportedStructs
- if true, the ArrowSchema struct will be closed when this method completes.- Returns:
- Imported schema object
-
importIntoVector
public static void importIntoVector(BufferAllocator allocator, ArrowArray array, FieldVector vector, DictionaryProvider provider) Equivalent to callingimportIntoVector(BufferAllocator, ArrowArray, FieldVector, DictionaryProvider, boolean)
importIntoVector(allocator, array, vector, provider, true)}.- Parameters:
allocator
- Buffer allocatorarray
- C data interface struct holding the array datavector
- Imported vector object [out]provider
- Dictionary provider to load dictionary vectors to (optional)- See Also:
-
importIntoVector
public static void importIntoVector(BufferAllocator allocator, ArrowArray array, FieldVector vector, DictionaryProvider provider, boolean closeImportedStructs) Import Java vector from the C data interface.On successful completion, the ArrowArray struct will have been moved (as per the C data interface specification) to a private object held alive by the resulting array.
- Parameters:
allocator
- Buffer allocatorarray
- C data interface struct holding the array datavector
- Imported vector object [out]provider
- Dictionary provider to load dictionary vectors to (optional)closeImportedStructs
- if true, the ArrowArray struct will be closed when this method completes successfully.
-
importVector
public static FieldVector importVector(BufferAllocator allocator, ArrowArray array, ArrowSchema schema, CDataDictionaryProvider provider) Equivalent to callingimportVector(allocator, array, schema, provider, true)
.- Parameters:
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)- Returns:
- Imported vector object
- See Also:
-
importVector
public static FieldVector importVector(BufferAllocator allocator, ArrowArray array, ArrowSchema schema, CDataDictionaryProvider provider, boolean closeImportedStructs) Import Java vector and its type from the C data interface.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.
- Parameters:
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)closeImportedStructs
- if true, the ArrowArray struct will be closed when this method completes successfully and the ArrowSchema struct will be always be closed.- Returns:
- Imported vector object
-
importIntoVectorSchemaRoot
public static void importIntoVectorSchemaRoot(BufferAllocator allocator, ArrowArray array, VectorSchemaRoot root, DictionaryProvider provider) Equivalent to callingimportIntoVectorSchemaRoot(allocator, array, root, provider, true)
.- Parameters:
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)- See Also:
-
importIntoVectorSchemaRoot
public static void importIntoVectorSchemaRoot(BufferAllocator allocator, ArrowArray array, VectorSchemaRoot root, DictionaryProvider provider, boolean closeImportedStructs) Import record batch from the C data interface into vector schema root.The ArrowArray struct has its contents moved (as per the C data interface specification) to a private object held alive by the resulting vector schema root.
The schema of the vector schema root must match the input array (undefined behavior otherwise).
- Parameters:
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)closeImportedStructs
- if true, the ArrowArray struct will be closed when this method completes successfully
-
importVectorSchemaRoot
public static VectorSchemaRoot importVectorSchemaRoot(BufferAllocator allocator, ArrowSchema schema, CDataDictionaryProvider provider) Equivalent to callingimportVectorSchemaRoot(allocator, schema, provider, true)
.- Parameters:
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)- Returns:
- Imported vector schema root
- See Also:
-
importVectorSchemaRoot
public static VectorSchemaRoot importVectorSchemaRoot(BufferAllocator allocator, ArrowSchema schema, CDataDictionaryProvider provider, boolean closeImportedStructs) Import Java vector schema root from a C data interface Schema.The type represented by the ArrowSchema struct must be a struct type array.
The ArrowSchema struct is released, even if this function fails.
- Parameters:
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)closeImportedStructs
- if true, the ArrowSchema struct will be closed when this method completes- Returns:
- Imported vector schema root
-
importVectorSchemaRoot
public static VectorSchemaRoot importVectorSchemaRoot(BufferAllocator allocator, ArrowArray array, ArrowSchema schema, CDataDictionaryProvider provider) Equivalent to callingimportVectorSchemaRoot(allocator, array, schema, provider, true)
.- Parameters:
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)- Returns:
- Imported vector schema root
- See Also:
-
importVectorSchemaRoot
public static VectorSchemaRoot importVectorSchemaRoot(BufferAllocator allocator, ArrowArray array, ArrowSchema schema, CDataDictionaryProvider provider, boolean closeImportedStructs) Import Java vector schema root from the C data interface.The type represented by the ArrowSchema struct must be a struct type array.
The ArrowArray struct has its contents moved (as per the C data interface specification) to a private object held alive by the resulting record batch. The ArrowSchema struct is released, even if this function fails.
Prefer
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.- Parameters:
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)closeImportedStructs
- if true, the ArrowArray struct will be closed when this method completes successfully and the ArrowSchema struct will be always be closed.- Returns:
- Imported vector schema root
-
importArrayStream
Equivalent to callingimportArrayStream(allocator, stream, true)
.- Parameters:
allocator
- Buffer allocator for allocating the output data.stream
- C stream interface struct to import.- Returns:
- Imported reader
- See Also:
-
importArrayStream
public static ArrowReader importArrayStream(BufferAllocator allocator, ArrowArrayStream stream, boolean closeImportedStructs) Import an ArrowArrayStream as anArrowReader
.On successful completion, the ArrowArrayStream struct will have been moved (as per the C data interface specification) to a private object held alive by the resulting ArrowReader.
- Parameters:
allocator
- Buffer allocator for allocating the output data.stream
- C stream interface struct to import.closeImportedStructs
- if true, the ArrowArrayStream struct will be closed when this method completes successfully- Returns:
- Imported reader
-