java.lang.Object
org.apache.arrow.c.ArrowSchema
- All Implemented Interfaces:
AutoCloseable,BaseStruct
C Data Interface ArrowSchema.
Represents a wrapper for the following C structure:
struct ArrowSchema {
// Array type description
const char* format;
const char* name;
const char* metadata;
int64_t flags;
int64_t n_children;
struct ArrowSchema** children;
struct ArrowSchema* dictionary;
// Release callback
void (*release)(struct ArrowSchema*);
// Opaque producer-specific data
void* private_data;
};
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSnapshot of the ArrowSchema raw data. -
Method Summary
Modifier and TypeMethodDescriptionstatic ArrowSchemaallocateNew(BufferAllocator allocator) Create ArrowSchema by allocating memory.voidclose()Close to release the main buffer.voidMark the schema as released.longGet memory address.voidrelease()Call the release callback of an ArrowArray.voidsave(ArrowSchema.Snapshot snapshot) Write values from Snapshot to the underlying ArrowSchema memory buffer.snapshot()Take a snapshot of the ArrowSchema raw values.static ArrowSchemawrap(long memoryAddress) Create ArrowSchema from an existing memory address.
-
Method Details
-
wrap
Create ArrowSchema from an existing memory address.The resulting ArrowSchema does not own the memory.
- Parameters:
memoryAddress- Memory address to wrap- Returns:
- A new ArrowSchema instance
-
allocateNew
Create ArrowSchema by allocating memory.The resulting ArrowSchema owns the memory.
- Parameters:
allocator- Allocator for memory allocations- Returns:
- A new ArrowSchema instance
-
markReleased
public void markReleased()Mark the schema as released. -
memoryAddress
public long memoryAddress()Description copied from interface:BaseStructGet memory address.- Specified by:
memoryAddressin interfaceBaseStruct- Returns:
- Memory address
-
release
public void release()Description copied from interface:BaseStructCall the release callback of an ArrowArray.This function must not be called for child arrays.
- Specified by:
releasein interfaceBaseStruct
-
close
public void close()Description copied from interface:BaseStructClose to release the main buffer.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceBaseStruct
-
snapshot
Take a snapshot of the ArrowSchema raw values.- Returns:
- snapshot
-
save
Write values from Snapshot to the underlying ArrowSchema memory buffer.
-