Vortex Documentation
repository·develop·Indexed 25 days ago
https://github.com/vortex-data/vortexVortex is a high-performance columnar file format and toolkit optimized for object storage, offering faster random access, scans, and writes than Apache Parquet. It includes specialized encodings like FSST for string-like data with LIKE pushdown support and OnPair for dictionary-based compression with fast per-row random access. The toolkit provides the bench-orchestrator (vx-bench) for performance comparison across engines like DataFusion and DuckDB, as well as dedicated benchmarks for compression and random access.
What's inside Vortex
- Vortex FSST is an encoding designed for Binary and UTF-8 data. It leverages the Fast Static Symbol Table (FSST) compression algorithm to optimize storage and retrieval of string-like data.
Overview of Vortex BtrBlocks Compressor
developVortex BtrBlocks is a compressor designed for BtrBlocks. It includes a decision tree mechanism to determine the most efficient compression strategy for given data blocks.Overview of vortex-cuda
developThevortex-cudapackage provides CUDA execution support and Arrow C Device export capabilities for Vortex arrays. It enables interoperability between Vortex and Arrow-compatible CUDA environments.Overview of Vortex OnPair Encoding
developVortex OnPair is an encoding designed for Binary and UTF-8 data using the OnPair short-string compression algorithm. It is a dictionary-based encoder that provides fast per-row random access. Theonpaircrate acts as the trainer/encoder and wraps the resulting column as a Vortex array, enabling cascading-compressor support on every integer child.Overview of the Vortex Java API
developThe Vortex Java API provides bindings for the Vortex library, allowing Java applications to interact with Vortex arrays and files. The API is divided into two primary components:
- Vortex JNI: Core JNI bindings providing direct access to Vortex functionality.
- Vortex Spark: Integration for Apache Spark, enabling Spark to read Vortex files.
Understand Vortex Layouts
developLayouts are the out-of-memory equivalent of Vortex arrays. They are hierarchical structures consisting of a vtable, metadata,
dtype, children, and lazy buffers called "segments".Key characteristics:
- Persistence: The tree structure can be serialized and persisted.
- Lazy Loading: During deserialization, layouts bind to a segment source that lazily fetches data buffers.
- Storage Agnostic: Supports efficient columnar scans over local disk, object stores, remote caches (e.g., Redis, Postgres block storage), and more.
- File Format: The Vortex file format is essentially a serialized layout tree with data segments stored within the same file.
Understand the VTable and Dispatch Pattern
developVortex uses a VTable-based dispatch pattern to handle type erasure and polymorphism for core data types (ExtDType, Expr, Layout, and Array). This pattern avoids the overhead of
dyn Traitby using a combination of a generic struct (e.g.,Array<V>) and a VTable trait (e.g.,ArrayVTable).Key components of the pattern:
- Generic Struct (
Array<V>): Holds common metadata (likedtype,len, andstats) and the encoding-specific data (array: V::Array). It provides inherent methods for operations likeslice,filter, andtake. - VTable Trait (
ArrayVTable): Defines the interface for specific encodings. It includes an associated typeArraywhich holds the actual encoding-specific data (buffers, children, etc.). - Erased Reference (
ArrayRef): A type-erased handle (typicallyArc<dyn DynArray>) used when the specific encoding is not known at compile time. It uses a thin forwarder to call methods on the underlying generic struct. - ZST VTable: The VTable itself is often a Zero Sized Type (ZST) used to host constructors and dispatch logic.
- Generic Struct (
Use vortex-proto for Protocol Buffers definitions
developThevortex-protocrate provides Protocol Buffers definitions used to serialize and deserialize messages across different crates within the Vortex workspace. Use this crate when you need to convert data structures into protobuf messages or back again.Understand Vortex Core Concepts
developVortex is a modular ecosystem designed for compressed columnar data across in-memory, on-disk, and over-the-wire scenarios. Its architecture is built around four pillars:
- DTypes: A logical type system (e.g.,
UTF8) that defines data meaning independently of physical encoding. - Arrays: The in-memory representation. Unlike Arrow, Vortex arrays can be compressed (e.g., bit-packed integers). They use the same representation on disk and over the wire to enable zero-copy I/O.
- Compute: Functions that operate directly on compressed arrays by dispatching to encoding-specific kernels.
- Layouts: Systems that organize arrays into larger-than-memory datasets, such as chunked row groups, and support various block storage backends (local disk, object stores, caches).
- DTypes: A logical type system (e.g.,
Access Vortex Language Bindings
developVortex provides language bindings for several environments. You can find specific API references for the following languages in the documentation directory:
- Python: Python-specific interfaces and usage.
- C: C language bindings.
- Java: Java language bindings.
Understand Buffer Handles
developArrays store physical data in buffer handles. These are opaque objects representing underlying data buffers. Because they are opaque, buffers can be allocated on various devices, such as CPU host memory or GPUs, without changing the array's logical interface.Use Vortex files as Arrow Datasets
developVortex files implement the Arrow Dataset interface. This allows you to use Vortex files efficiently within query engines that support Arrow, such as DuckDB and Polars.
Key performance characteristics:
- Predicate Pushdown: Vortex reads data proportional to the number of rows passing a filter condition.
- Projection Pushdown: Vortex reads data proportional to the number of columns in a selection.
- Encoding Efficiency: For most Vortex encodings, these properties hold true even when filtering for a single row.