Skip to content

Commit 1c99580

Browse files
mprammerclaude
andcommitted
spec refresh
Documentation restructure (consolidated Specification section, developer guide grouped by audience, refreshed concepts/user-guide) plus a specification of the on-disk/on-wire encoding format (validity contract, per-encoding byte layouts, array/scalar/file/dtype framing) and a docs-conformance harness that derives the stable-encoding set from the code. Signed-off-by: mprammer <martin@spiraldb.com> Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c7c28d8 commit 1c99580

69 files changed

Lines changed: 7468 additions & 502 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,17 @@ jobs:
6464
-c .yamllint.yaml \
6565
.github/
6666
67+
docs-conformance:
68+
name: "Docs conformance"
69+
runs-on: ubuntu-latest
70+
timeout-minutes: 10
71+
steps:
72+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
73+
- name: Check docs facts match their source of truth
74+
run: python3 scripts/check-docs-conformance.py
75+
- name: Self-test the conformance checker (catch matcher regressions)
76+
run: python3 scripts/check-docs-conformance.py --self-test
77+
6778
python-lint:
6879
name: "Python (lint)"
6980
runs-on: >-

.github/workflows/docs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ jobs:
2020
timeout-minutes: 30
2121
steps:
2222
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
23+
- name: Check docs conformance (fail before publishing stale docs)
24+
# Runs FIRST, before the changelog generator writes generated release-note pages into docs/
25+
# (their historical text would otherwise be scanned and could fail the current-docs lint).
26+
run: |
27+
python3 scripts/check-docs-conformance.py
28+
python3 scripts/check-docs-conformance.py --self-test
2329
- uses: ./.github/actions/setup-rust
2430
with:
2531
repo-token: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![CodSpeed Badge](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/vortex-data/vortex)
77
[![Crates.io](https://img.shields.io/crates/v/vortex.svg)](https://crates.io/crates/vortex)
88
[![PyPI - Version](https://img.shields.io/pypi/v/vortex-data)](https://pypi.org/project/vortex-data/)
9-
[![Maven - Version](https://img.shields.io/maven-central/v/dev.vortex/vortex-spark)](https://central.sonatype.com/artifact/dev.vortex/vortex-spark)
9+
[![Maven - Version](https://img.shields.io/maven-central/v/dev.vortex/vortex-spark_2.13)](https://central.sonatype.com/artifact/dev.vortex/vortex-spark_2.13)
1010
[![codecov](https://codecov.io/github/vortex-data/vortex/graph/badge.svg)](https://codecov.io/github/vortex-data/vortex)
1111
[![Cite](https://img.shields.io/badge/cite-CITATION.cff-blue)](CITATION.cff)
1212

docs/_extra/_redirects

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Cloudflare Pages redirects for docs.vortex.dev.
2+
# Copied verbatim to the site root via `html_extra_path` in conf.py.
3+
# More specific rules must come before broader splat rules.
4+
5+
# The internals/serialization page was split across several specification pages
6+
# (array-format, ipc-format, reading-a-file); send it to the Specification index, which
7+
# fans out to all of them.
8+
/developer-guide/internals/serialization /specification/ 301
9+
/developer-guide/internals/serialization.html /specification/ 301
10+
11+
# The specs/ section was renamed to specification/. Cover the section root explicitly
12+
# (the splat does not match the bare /specs path) before the child-path splat rule.
13+
/specs /specification/ 301
14+
/specs/ /specification/ 301
15+
/specs/index.html /specification/ 301
16+
/specs/* /specification/:splat 301

docs/api/c/index.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
C API
22
=====
33

4-
The Vortex C API provides a low-level FFI interface to the Vortex library. It is the foundation for
5-
other language bindings (including C++) and is suitable for embedding Vortex into C applications or
6-
building higher-level wrappers.
4+
The Vortex C API provides a low-level FFI interface to the Vortex library. It is the intended
5+
foundation for other language bindings and is suitable for embedding Vortex into C applications or
6+
building higher-level wrappers. (The C++ binding currently uses a direct ``cxx`` Rust bridge; a future
7+
migration to build it on top of this C FFI is planned.)
78

89
.. warning::
910
This API should be considered entirely unstable. It *will* change. Please reach out if a stable

docs/api/cpp/index.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
C++ API
22
=======
33

4-
The Vortex C++ API provides an idiomatic C++ wrapper around the Vortex C FFI, built using
5-
`cxx <https://cxx.rs/>`_. It currently supports reading and writing Vortex files and integrates
6-
with the Arrow C Data Interface via `nanoarrow <https://arrow.apache.org/nanoarrow/>`_.
4+
The Vortex C++ API is an idiomatic C++ binding built with `cxx <https://cxx.rs/>`_, which generates
5+
a direct bridge between C++ and Rust. It supports reading and writing Vortex files and integrates
6+
with the Arrow C Data Interface via `nanoarrow <https://arrow.apache.org/nanoarrow/>`_. A future
7+
migration to build the C++ API on top of the C FFI is planned.
78

89
In the future we will expand the C++ API to cover Vortex's plugin and extension points. Please
910
reach out if you are interested in extending Vortex from C++ so we can prioritize these features.

docs/api/java/index.rst

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,17 @@ They support any Linux distribution with a GLIBC version >= 2.31. This includes
3939
* Ubuntu 20.04 or newer
4040

4141

42-
Usage Example
43-
-------------
44-
45-
Here's a basic example of using the Vortex Java API to read a Vortex file:
46-
47-
.. code-block:: java
48-
49-
import dev.vortex.api.File;
50-
import dev.vortex.api.Array;
42+
Core API
43+
--------
5144

52-
// Open a Vortex file
53-
File vortexFile = File.open("path/to/file.vortex");
45+
The main entry points of the Vortex Java API are:
5446

55-
// Read arrays from the file
56-
Array array = vortexFile.readArray();
47+
* ``Session`` — the top-level handle that owns data sources and writers.
48+
* ``DataSource`` — opens a Vortex file, glob, or table via ``DataSource.open(session, uri)`` and
49+
exposes its schema and row count.
50+
* ``Scan`` / ``Partition`` — a scan over a ``DataSource`` iterates its partitions, yielding
51+
Arrow-compatible batches.
52+
* ``VortexWriter`` — writes arrays to a Vortex file.
5753

58-
// Work with the array data
59-
System.out.println("Array length: " + array.getLength());
54+
See the `Vortex JNI API <../../_static/vortex-jni/index.html>`_ above for the full,
55+
method-level reference.

docs/api/python/arrays.rst

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ Base Class
2222
Canonical Encodings
2323
-------------------
2424

25-
Each :class:`~vortex.DType` has a corresponding canonical encoding. These encodings represent the uncompressed version
26-
of the array, and are also zero-copy to Apache Arrow.
25+
Each :class:`~vortex.DType` has a corresponding canonical encoding, with the sole exception of ``Union`` (not yet
26+
canonicalized). These encodings represent the uncompressed version of the array, and are also zero-copy to
27+
Apache Arrow. The classes below are the canonical encodings currently exposed in Python.
2728

2829
.. autoclass:: vortex.NullArray
2930
:members:
@@ -37,19 +38,15 @@ of the array, and are also zero-copy to Apache Arrow.
3738
:members:
3839

3940

40-
.. autoclass:: vortex.VarBinArray
41-
:members:
42-
43-
4441
.. autoclass:: vortex.VarBinViewArray
4542
:members:
4643

4744

48-
.. autoclass:: vortex.StructArray
45+
.. autoclass:: vortex.FixedSizeListArray
4946
:members:
5047

5148

52-
.. autoclass:: vortex.ListArray
49+
.. autoclass:: vortex.StructArray
5350
:members:
5451

5552

@@ -72,6 +69,14 @@ Utility Encodings
7269
:members:
7370

7471

72+
.. autoclass:: vortex.VarBinArray
73+
:members:
74+
75+
76+
.. autoclass:: vortex.ListArray
77+
:members:
78+
79+
7580
Compressed Encodings
7681
--------------------
7782

docs/api/python/index.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ The Python bindings require Python 3.11 or newer. Pre-built wheels are available
2727
* x86_64 Linux
2828
* ARM64 Linux
2929
* Apple Silicon macOS
30+
* Intel macOS
3031

3132
They support any Linux distribution with a GLIBC version >= 2.17. This includes
3233

@@ -41,14 +42,17 @@ Here's a basic example of using the Vortex Python API to write and read a Vortex
4142

4243
.. code-block:: python
4344
45+
import pyarrow as pa
4446
import vortex
4547
4648
# Write a Vortex file from a PyArrow table
47-
vortex.io.write_path(my_table, "data.vortex")
49+
my_table = pa.table({"id": [1, 2, 3], "name": ["a", "b", "c"]})
50+
vortex.io.write(my_table, "data.vortex")
4851
4952
# Read a Vortex file
50-
dataset = vortex.dataset("data.vortex")
51-
table = dataset.to_arrow()
53+
vf = vortex.open("data.vortex")
54+
reader = vf.to_arrow() # a pyarrow.RecordBatchReader
55+
table = reader.read_all()
5256
5357
5458
API Reference

docs/concepts/arrays.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,22 @@ define their own.
4141

4242
### Canonical Arrays
4343

44-
In order to avoid having to implement logic for an exponential combination of encodings, Vortex defines one canonical
45-
encoding per logical data type. All arrays can eventually be decompressed one of these canonical encodings.
44+
In order to avoid having to implement logic for an exponential combination of encodings, Vortex defines a canonical
45+
encoding for each logical data type — every type except `Union`, which is not yet canonicalized. Arrays of those types
46+
can eventually be decompressed to one of the canonical encodings listed below.
4647

4748
| Data Type | Canonical Encoding |
4849
|------------------------|----------------------|
4950
| `DType::Null` | `NullArray` |
5051
| `DType::Bool` | `BoolArray` |
5152
| `DType::Primitive` | `PrimitiveArray` |
52-
| `DType::UTF8` | `VarBinViewArray` |
53+
| `DType::Decimal` | `DecimalArray` |
54+
| `DType::Utf8` | `VarBinViewArray` |
5355
| `DType::Binary` | `VarBinViewArray` |
5456
| `DType::Struct` | `StructArray` |
5557
| `DType::List` | `ListViewArray` |
5658
| `DType::FixedSizeList` | `FixedSizeListArray` |
59+
| `DType::Variant` | `VariantArray` |
5760
| `DType::Extension` | `ExtensionArray` |
5861

5962
### Builtin Arrays
@@ -100,15 +103,15 @@ These can be found in the `encodings/` directory of the Vortex repository.
100103
Arrays carry their own statistics with them, allowing many compute functions to short-circuit or optimize their
101104
implementations. Currently, the available statistics are:
102105

106+
* `is_constant`: Whether the array holds only a single unique value (treating nulls as equal).
107+
* `is_sorted`: Whether the array's values are in ascending order.
108+
* `is_strict_sorted`: Whether the array's values are in strictly ascending order, with no duplicates.
109+
* `max`: The maximum value in the array (ignoring nulls).
110+
* `min`: The minimum value in the array (ignoring nulls).
111+
* `sum`: The sum of the non-null values in the array.
103112
* `null_count`: The number of null values in the array.
104-
* `true_count`: The number of `true` values in a boolean array.
105-
* `run_count`: The number of consecutive runs in an array.
106-
* `is_constant`: Whether the array only holds a single unique value
107-
* `is_sorted`: Whether the array values are sorted.
108-
* `is_strict_sorted`: Whether the array values are sorted and unique.
109-
* `min`: The minimum value in the array.
110-
* `max`: The maximum value in the array.
111-
* `uncompressed_size`: The size of the array in memory before any compression.
113+
* `uncompressed_size_in_bytes`: The size of the array in memory before any compression.
114+
* `nan_count`: The number of NaN values in the array.
112115

113116
## Execution
114117

0 commit comments

Comments
 (0)