importArray
ArrayData importArray(const ArrowArray arr, DataType dtype,
bool largeOffsets = true, const ArrowSchema * schema = null) @trustedImports an ArrowArray into a fresh sealed chunk (copy-on-import: the foreign buffers are copied, the source's release fires normally, and no foreign memory is held after the return). The ABI's offset field is honored - the imported window is [offset .. offset + length) with the validity bits re-based to slot 0. A null_count of -1 (unknown) is computed from the validity bitmap; a zero null count ignores the validity buffer (all valid, the sentinel form). The ABI carries no buffer lengths, so what is checkable is checked (buffer counts, offset and length sanity, monotonic non-negative string offsets) and the rest is the documented FFI trust boundary.
Parameters
arr | the exported array |
dtype | the target dtype |
largeOffsets | whether STRING offsets are int64 ("U" large_string); int32 "u" offsets widen on import |
Returns
Throws
metadata (never a partial chunk).
Ditto, schema-driven: the dtype and the offsets width come from the paired ArrowSchema (the ABI's intended entry).