dartarrow

Arrow IPC

package:dartarrow/ipc.dart reads and writes Arrow IPC format V5 streams and files in pure Dart, shaped like pyarrow.ipc.

Guide · API reference · GitHub

Read and write

import 'package:dartarrow/arrow.dart' as pa;
import 'package:dartarrow/ipc.dart' as ipc;

final table = pa.table({'id': pa.array([1, 2], type: pa.int64())});
final stream = (ipc.newStream(table.schema)..writeTable(table)).close();
final restored = ipc.openStream(stream).readAll(); // Table

final file = (ipc.newFile(restored.schema)..writeTable(restored)).close();
final reader = ipc.openFile(file);
reader.numRecordBatches;
reader.getBatch(0);
ReturnsMain members
openStreamRecordBatchStreamReaderschema, readNextBatch() (null at end), readAll()
openFileRecordBatchFileReaderschema, numRecordBatches, getBatch(i), readAll()
newStream, newFilewriterswriteBatch, writeTable, write, close() (returns the bytes)

I/O is in memory (Uint8List); file access is left to the caller. Uncompressed bodies are read zero-copy, so keep the input bytes alive and unmodified. All standard Arrow types round-trip, including nested dictionaries, dictionary deltas and extension annotations. See example/arrow_ipc.dart.

Compression

PlatformLZ4_FRAME readZSTD readWrite
Dart VMyesyesuncompressed
Web (dart2js)yesunsupporteduncompressed

The web LZ4 decoder bounds-checks its input but does not verify frame checksums. External LZ4 dictionaries are unsupported.

Limits

  • Little-endian only. Big-endian input raises UnsupportedError.
  • IpcLimits bounds depth, fields, rows, buffers, message size, dictionaries and batches. Defaults are conservative; raise them for large trusted input.
  • Malformed input raises FormatException. Unknown codecs or types raise UnsupportedError.
  • bindingInt128() and bindingUint128() cannot be written.
  • Extension metadata must be UTF-8. Other metadata is preserved as raw bytes.

Verification

PyArrow 26.0.0 stream and file fixtures in test/conformance/fixtures/arrow_ipc/ are read by Dart without Python. Dart-written output is read back and validated by PyArrow in CI. See CONTRIBUTING.md to run it.