public class ArrowArrayStream extends Object implements BaseStruct
Represents a wrapper for the following C structure:
struct ArrowArrayStream {
int (*get_schema)(struct ArrowArrayStream*, struct ArrowSchema* out);
int (*get_next)(struct ArrowArrayStream*, struct ArrowArray* out);
const char* (*get_last_error)(struct ArrowArrayStream*);
void (*release)(struct ArrowArrayStream*);
void* private_data;
};
| Modifier and Type | Class and Description |
|---|---|
static class |
ArrowArrayStream.Snapshot
Snapshot of the ArrowArrayStream raw data.
|
| Modifier and Type | Method and Description |
|---|---|
static ArrowArrayStream |
allocateNew(BufferAllocator allocator)
Create ArrowArrayStream by allocating memory.
|
void |
close()
Close to release the main buffer.
|
void |
getNext(ArrowArray array)
Get the next batch in the stream.
|
void |
getSchema(ArrowSchema schema)
Get the schema of the stream.
|
void |
markReleased()
Mark the array as released.
|
long |
memoryAddress()
Get memory address.
|
void |
release()
Call the release callback of an ArrowArray.
|
void |
save(ArrowArrayStream.Snapshot snapshot)
Write values from Snapshot to the underlying ArrowArrayStream memory buffer.
|
ArrowArrayStream.Snapshot |
snapshot()
Take a snapshot of the ArrowArrayStream raw values.
|
static ArrowArrayStream |
wrap(long memoryAddress)
Create ArrowArrayStream from an existing memory address.
|
public static ArrowArrayStream wrap(long memoryAddress)
The resulting ArrowArrayStream does not own the memory.
memoryAddress - Memory address to wrappublic static ArrowArrayStream allocateNew(BufferAllocator allocator)
The resulting ArrowArrayStream owns the memory.
allocator - Allocator for memory allocationspublic void markReleased()
public long memoryAddress()
BaseStructmemoryAddress in interface BaseStructpublic void release()
BaseStructThis function must not be called for child arrays.
release in interface BaseStructpublic void getSchema(ArrowSchema schema) throws IOException
schema - The ArrowSchema struct to output toIOException - if the stream returns an errorpublic void getNext(ArrowArray array) throws IOException
array - The ArrowArray struct to output toIOException - if the stream returns an errorpublic void close()
BaseStructclose in interface AutoCloseableclose in interface BaseStructpublic ArrowArrayStream.Snapshot snapshot()
public void save(ArrowArrayStream.Snapshot snapshot)
Copyright © 2024 The Apache Software Foundation. All rights reserved.