parquet_variant_compute/lib.rs
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: See the NOTICE file distributed with this work for additional information regarding copyright ownership
3// SPDX-FileContributor: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements
4
5//! [`VariantArray`] and compute kernels for the [Variant Binary Encoding] from [Apache Parquet].
6//!
7//! ## Main APIs
8//! - [`VariantArray`] : Represents an array of `Variant` values.
9//! - [`VariantArrayBuilder`]: For building [`VariantArray`]
10//!
11//! # Compute Kernels
12//! - [`json_to_variant()`]: Function to convert Arrays of JSON strings to a `VariantArray`.
13//! - [`variant_to_json()`]: Function to convert a `VariantArray` to arrays of JSON strings.
14//! - [`cast_to_variant()`]: Cast Arrow arrays to `VariantArray`.
15//! - [`variant_get()`]: Convert `VariantArray` (or an inner path) to a strongly-typed Arrow array.
16//! - [`shred_variant()`]: Shred a `VariantArray` according to the provided shredding schema
17//! - [`unshred_variant()`]: Unshred a `VariantArray` to pure binary variant.
18//!
19//! ## 🚧 Work In Progress
20//!
21//! This crate is under active development and is not yet ready for production use.
22//! If you are interested in helping, you can find more information on the GitHub [Variant issue]
23//!
24//! [Variant Binary Encoding]: https://github.com/apache/parquet-format/blob/master/VariantEncoding.md
25//! [Apache Parquet]: https://parquet.apache.org/
26//! [`VariantPath`]: parquet_variant::VariantPath
27//! [Variant issue]: https://github.com/apache/arrow-rs/issues/6736
28//!
29//! # Platform Support
30//!
31//! Only little-endian platforms are officially supported and tested in CI.
32//! Big-endian platforms are not tested in CI and may not work correctly.
33//! Fixes for big-endian platforms are welcome and handled on a best-effort basis,
34//! but compatibility is not guaranteed.
35
36mod arrow_to_variant;
37mod cast_to_variant;
38mod from_json;
39mod shred_variant;
40mod to_json;
41mod type_conversion;
42mod unshred_variant;
43mod variant_array;
44mod variant_array_builder;
45mod variant_get;
46mod variant_to_arrow;
47
48pub use parquet_variant::VariantType;
49pub use variant_array::{ShreddingState, VariantArray, VariantArrayIter};
50pub use variant_array_builder::{VariantArrayBuilder, VariantValueArrayBuilder};
51
52pub use cast_to_variant::{cast_to_variant, cast_to_variant_with_options};
53pub use from_json::json_to_variant;
54pub use shred_variant::{IntoShreddingField, ShreddedSchemaBuilder, shred_variant};
55pub use to_json::variant_to_json;
56pub use unshred_variant::unshred_variant;
57pub use variant_get::{GetOptions, variant_get};