![]() |
Signet Forge 0.1.0
C++20 Parquet library with AI-native extensions
|
DEMO |
Imports Arrow C Data Interface arrays into Signet TensorView or OwnedTensor. More...
#include <arrow_bridge.hpp>
Static Public Member Functions | |
| static expected< TensorView > | import_array (const ArrowArray *array, const ArrowSchema *schema) |
| Import an ArrowArray as a TensorView (zero-copy). | |
| static expected< OwnedTensor > | import_array_copy (const ArrowArray *array, const ArrowSchema *schema) |
| Import an ArrowArray as an OwnedTensor (deep copy). | |
Imports Arrow C Data Interface arrays into Signet TensorView or OwnedTensor.
Supports two import modes:
Definition at line 482 of file arrow_bridge.hpp.
|
inlinestatic |
Import an ArrowArray as a TensorView (zero-copy).
The ArrowArray must contain a single-buffer primitive numeric type (matching a single-character format string). The returned TensorView wraps buffers[1] directly – the ArrowArray must remain alive and unreleased for the entire lifetime of the TensorView.
The tensor is shaped as 1D: [length]. The ArrowArray.offset field is respected (data pointer is advanced by offset * element_size).
| array | Pointer to a valid, unreleased ArrowArray (must not be null). |
| schema | Pointer to a valid ArrowSchema describing the array (must not be null). |
Validation checks performed:
Definition at line 508 of file arrow_bridge.hpp.
|
inlinestatic |
Import an ArrowArray as an OwnedTensor (deep copy).
Copies the data from the ArrowArray into a new heap allocation. After this call returns, the ArrowArray can be released independently – the OwnedTensor owns its data.
Internally delegates to import_array() for validation, then copies the TensorView's data into the OwnedTensor.
| array | Pointer to a valid, unreleased ArrowArray (must not be null). |
| schema | Pointer to a valid ArrowSchema describing the array (must not be null). |
Definition at line 625 of file arrow_bridge.hpp.