arrow-viewer
v1.0.1
Published
DataTable viewer for Apache Arrow IPC files — CLI + Express + WebSocket
Maintainers
Readme
arrow-viewer
A fast, browser-based DataTable viewer for Apache Arrow IPC files (
.arrow).
Serves a Tailwind-styled dark/light UI over Express + WebSocket — paginated, searchable, sortable.
Screenshot

Features
| Feature | Detail |
|---------|--------|
| Fast load | 125K-row / 144 MB Arrow file loads in ~65 ms |
| Paginated WS | Only the current page is streamed — never the full table |
| Search | Case-insensitive substring match across all columns, 350 ms debounce |
| Sort | Click any column header; toggles asc ↔ desc |
| Click-to-expand | Long cells open a modal with pretty-printed JSON |
| Schema panel | Collapsible sidebar: field names, Arrow types, nullability |
| Dark / light | Tailwind-powered; preference persisted to localStorage |
| CLI | --file and --port flags via Commander |
Install
# Install globally
npm install -g arrow-viewer
Requirements: Node.js ≥ 18
Usage
# Basic — opens on http://localhost:3737
arrow-viewer --file train/data-00000-of-00001.arrow
# Custom port
arrow-viewer --file train/data-00000-of-00001.arrow --port 4000
# Suppress auto-open
arrow-viewer --file train/data-00000-of-00001.arrow --no-openOptions
| Flag | Default | Description |
|------|---------|-------------|
| -f, --file <path> | (required) | Path to the .arrow IPC file |
| -p, --port <number> | 3737 | Port to listen on |
| --no-open | — | Do not auto-open the browser |
Working with HuggingFace Datasets
Arrow files saved by HuggingFace datasets are in Apache Arrow IPC file format — directly compatible:
from datasets import load_dataset
ds = load_dataset("abc/sample-decision-150K")
ds.save_to_disk("./abc_data") # saves .arrow + metadataThen view any split:
arrow-viewer --file bev_data/train/data-00000-of-00001.arrowWhy Arrow?

Benefits of the Apache Arrow Format
Apache Arrow is a language-independent columnar memory and on-disk format for tabular data. It is the storage format used by HuggingFace datasets, Apache Parquet, DuckDB, Polars, and many ML pipelines.
1. Columnar Layout — Read Only What You Need
Row-oriented formats (CSV, JSON, SQLite) store all fields of a record together:
Row 1: [state, questions_json, domain, question_types, question_count]
Row 2: [state, questions_json, domain, question_types, question_count]
...To compute mean(question_count) you must scan all fields on every row.
Columnar (Arrow) stores each field contiguously:
state : [val1, val2, val3, …]
questions_json : [val1, val2, val3, …]
domain : [val1, val2, val3, …]
question_count : [val1, val2, val3, …] ← only this needs readingResult: reading a single column out of 5 is 5× less I/O — a 100× gain for analytics with 500 columns.
2. Zero-Copy Reads
Arrow defines a binary IPC format where the on-disk layout is identical to the in-memory layout. Libraries such as apache-arrow (JS, Python, C++) can memory-map the file and pass pointers to application code without deserialisation.
CSV/JSON require:
file bytes → parse text → allocate Python strings → build list → send to NumPyArrow requires:
file bytes → mmap → pointer (no copying, no parsing)The viewer loads 125,614 rows × 5 columns (144 MB) in ~65 ms on a laptop because of this.
3. Typed Columns with Null Support
Every column in Arrow has a declared type (Int64, LargeUtf8, List<Utf8>, …) plus a separate null bitmap. This means:
- No ambiguity:
"3"vs3vsnullare distinct - Arithmetic on
Int64columns uses SIMD-vectorisable integer math, not generic Python object overhead - Null values are stored in a compact 1-bit-per-row bitmap — no sentinel values like
NaN,"", or-999
4. Standardised Cross-Language Interchange
The Arrow IPC format is a shared standard across:
| Language / Library | Arrow support |
|-------------------|---------------|
| Python / pandas | pyarrow |
| Python / HuggingFace datasets | native |
| Python / Polars | native |
| JavaScript | apache-arrow (npm) |
| Java | arrow-java |
| C++ / DuckDB | native |
| Go / Rust | official crates / packages |
Data written by a Python datasets.save_to_disk() call is immediately readable by this Node.js viewer — no conversion step, because they both speak the same IPC wire format.
5. Efficient String Storage
Arrow offers two string types:
| Type | Offset width | Max string length | Max total bytes |
|------|-------------|-------------------|-----------------|
| Utf8 | 32-bit | 2 GB per string | 2 GB total |
| LargeUtf8 | 64-bit | 9 EB per string | 9 EB total |
Long text fields like questions_json (multi-question JSON blobs) use LargeUtf8, which stores all string data in a single contiguous buffer with an offset array. Random access to row i is O(1): just read offsets[i] and offsets[i+1].
Compare to a Python list of strings: each string is a separately allocated Python heap object with a reference-count header — fragmented, not cache-friendly.
6. Compression-Ready
Arrow files can embed column-level compression (LZ4, ZSTD) in the IPC format. HuggingFace datasets uses LZ4 by default, giving 3–6× size reduction on text-heavy datasets while retaining random-access semantics via chunk decompression.
7. Streaming / Chunked Access
Arrow defines both:
- IPC File format (random access via a footer index) — what
.arrowfiles use - IPC Stream format (sequential streaming) — what network transfers use
The tableFromIPC() API in apache-arrow handles both transparently, making the viewer work for files written by any Arrow-compatible tool.
8. Comparison Summary
| Capability | CSV | JSON | Parquet | Arrow IPC | |------------|-----|------|---------|---------------| | Column pruning | ✗ | ✗ | ✓ | ✓ | | Zero-copy read | ✗ | ✗ | partial | ✓ | | Typed schema | ✗ | ✗ | ✓ | ✓ | | Null bitmap | ✗ | ✗ | ✓ | ✓ | | Random row access | slow | slow | via row groups | O(1) | | Streaming | ✓ | ✓ | ✗ | ✓ | | Cross-language | ✓ | ✓ | ✓ | ✓ | | No parse step | ✗ | ✗ | ✗ | ✓ |
9. Why ML Pipelines Prefer Arrow
- Batching: a DataLoader can take a slice
table.slice(start, length)in microseconds — no copy, no decode. - Shuffle: an index permutation array is all that changes; the data buffer is never touched.
- Tokenisation caching: tokenised integer sequences stored as
List<Int32>columns load directly into PyTorch tensors viatorch.frombuffer. - Multi-process DataLoader: multiple workers can mmap the same Arrow file — each reads its shard with no IPC copy between processes.
References
- Apache Arrow Specification
- HuggingFace Datasets internals
- apache-arrow npm package
- DuckDB Arrow integration
License
MIT © Mohan Chinnappan
