Get the pointer to one ArrowArray FFI struct for a given chunk index and column index
Access the pointer to one
ArrowArray
struct representing one of the internal RecordBatch
es. This can be viewed or copied (without serialization) to an Arrow JS RecordBatch
by
using arrow-js-ffi
. You can access the
WebAssembly.Memory
instance by using wasmMemory
.
Example:
import * as arrow from "apache-arrow";
import { parseRecordBatch } from "arrow-js-ffi";
const wasmTable: FFITable = ...
const wasmMemory: WebAssembly.Memory = wasmMemory();
const jsBatches: arrow.RecordBatch[] = []
for (let i = 0; i < wasmTable.numBatches(); i++) {
// Pass `true` to copy arrays across the boundary instead of creating views.
const jsRecordBatch = parseRecordBatch(
wasmMemory.buffer,
wasmTable.arrayAddr(i),
wasmTable.schemaAddr(),
true
);
jsBatches.push(jsRecordBatch);
}
const jsTable = new arrow.Table(jsBatches);
number The chunk index to use
number pointer to an ArrowArray FFI struct in Wasm memory
A representation of an Arrow Table in WebAssembly memory exposed as FFI-compatible structs through the Arrow C Data Interface.