arrow-view-state
High-performance columnar permutation index and filter engine for Apache Arrow.
Overview
arrow-view-state is a pure indexing engine — no I/O, no column names, no pagination, no
application state. It separates view-state computation (sorting, filtering, selection) from
data access so that UI layers can reorder and filter millions of Arrow rows without copying
or rewriting the underlying RecordBatches.
Features
SortBuilder— streaming multi-column sort; feedRecordBatches one at a time, finish into aPermutationIndexPermutationIndex— virtual-to-physical row mapping; windowed reads, late materialisationFilterIndex— sparse filter backed by Roaring Bitmap with set algebra (and,or,not)PhysicalSelection— physical row IDs ready for Arrowtakeor Parquet row-selection pushdown- Parallel argsort via Rayon (optional, default-on)
- Memory-mapped storage for large indices that exceed RAM (
persistfeature) - Hash index for O(1) equality lookups (
hash-indexfeature) - Inverted index for token-based text search (
inverted-indexfeature) - SIMD predicate evaluation via
arrow-ord(evaluatefeature)
Installation
[]
= "0.1"
For WASM or minimal builds, disable the default parallel feature:
= { = "0.1", = false }
Quick Start
use Arc;
use ;
use ;
use SortField;
use ;
let schema = new;
let batch = try_new.unwrap;
// Sort by name asc, then value desc.
let fields = vec!;
let mut builder = new;
builder.push.unwrap;
let sorted = builder.finish.unwrap;
let range = sorted.read_range; // windowed read
let filter = from_ids;
let filtered = filter.apply_to_permutation; // sparse filter
let selection = sorted.to_physical_selection; // late materialisation
Examples
See EXAMPLES.md for annotated walkthroughs.
| Example | What it shows |
|---|---|
| Sort & Window | Multi-column sort, windowed read, late materialisation |
| Filter Algebra | Composing FilterIndex with and / or / not |
| Persist to Disk | Save and reload a PermutationIndex via the persist feature |
Feature Flags
| Flag | Default | Description |
|---|---|---|
parallel |
✓ | Parallel argsort via Rayon |
evaluate |
SIMD predicate evaluation → FilterIndex via arrow-ord |
|
hash-index |
O(1) equality lookup index | |
inverted-index |
Token-based text search index | |
mmap |
Memory-mapped temp storage for large sorts | |
persist |
Save/load indices to disk (implies mmap) |
|
full |
All of the above |
Further Reading
MSRV
Minimum supported Rust version: 1.94 (edition 2024).
Contributing
See CONTRIBUTING.md.
License
Licensed under either of MIT or Apache-2.0 at your option.