|
1 | 1 | // SPDX-License-Identifier: Apache-2.0 |
2 | 2 | // SPDX-FileCopyrightText: Copyright the Vortex contributors |
3 | 3 |
|
4 | | -//! This crate exposes a Vortex encoding that supports variant arrays, encoded as parquet's |
5 | | -//! [Variant encoding], in order to allow for zero-copy export to Arrow's new |
6 | | -//! [canonical extension type]. |
| 4 | +//! Vortex support for Arrow's canonical `arrow.parquet.variant` extension type. |
7 | 5 | //! |
8 | | -//! The encoding follows the Arrow Parquet Variant canonical extension type structure: |
9 | | -//! - `metadata` (binary, required): type information for arrays/objects, field names and offsets |
10 | | -//! - `value` (binary, optional): un-shredded serialized variant values |
11 | | -//! - `typed_value` (any type, optional): shredded column data with a known type |
| 6 | +//! This encoding provides a lossless representation of semi-structured data stored as |
| 7 | +//! [Parquet Variant values] inside Arrow columns. It also supports [shredded variant values], |
| 8 | +//! allowing systems to pass variant-encoded data around without special handling unless they |
| 9 | +//! need to inspect the encoded contents directly. |
12 | 10 | //! |
13 | | -//! At least one of `value` or `typed_value` must be present. The `typed_value` child supports |
14 | | -//! full recursive shredding — it can be a primitive type, a list (whose elements are variant |
15 | | -//! nodes with value/typed_value), or a struct (whose fields are variant nodes). |
| 11 | +//! The storage type is a `Struct` that follows the Arrow canonical extension contract: |
| 12 | +//! - `metadata` (required): a non-nullable binary child containing variant metadata |
| 13 | +//! - `value` (optional): a binary child containing unshredded variant bytes |
| 14 | +//! - `typed_value` (optional): a shredded child with a primitive, list, or struct layout |
16 | 15 | //! |
17 | | -//! [Variant encoding]: https://parquet.apache.org/docs/file-format/types/variantencoding/ |
18 | | -//! [canonical extension type]: https://arrow.apache.org/docs/format/CanonicalExtensions.html#parquet-variant |
| 16 | +//! At least one of `value` or `typed_value` must be present. Nested shredded values recurse |
| 17 | +//! through the same `value` and `typed_value` structure described by the canonical extension |
| 18 | +//! type documentation. |
| 19 | +//! |
| 20 | +//! See the Arrow canonical extension docs for the storage rules, and the Parquet format |
| 21 | +//! specification for the binary representation. |
| 22 | +//! |
| 23 | +//! [Parquet Variant values]: https://github.com/apache/parquet-format/blob/master/VariantEncoding.md |
| 24 | +//! [shredded variant values]: https://github.com/apache/parquet-format/blob/master/VariantShredding.md |
| 25 | +//! [Arrow canonical extension type]: https://arrow.apache.org/docs/format/CanonicalExtensions.html#parquet-variant |
19 | 26 |
|
20 | 27 | mod array; |
21 | 28 | mod operations; |
|
0 commit comments