A representation of an Arrow C Stream in WebAssembly memory exposed as FFI-compatible structs through the Arrow C Data Interface.

Unlike other Arrow implementations outside of JS, this always stores the "stream" fully materialized as a sequence of Arrow chunks.

Methods

  • 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 RecordBatches. 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);

    Parameters

    • chunk: number

      number The chunk index to use

    Returns number

    number pointer to an ArrowArray FFI struct in Wasm memory

  • Returns Uint32Array<ArrayBufferLike>

  • Returns void

  • Returns void

  • Get the total number of elements in this stream

    Returns number

  • Get the pointer to the ArrowSchema FFI struct

    Returns number