parquet_variant_compute/lib.rs
1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements. See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership. The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License. You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied. See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18#![deny(clippy::allow_attributes)]
19
20//! [`VariantArray`] and compute kernels for the [Variant Binary Encoding] from [Apache Parquet].
21//!
22//! ## Main APIs
23//! - [`VariantArray`] : Represents an array of `Variant` values.
24//! - [`VariantArrayBuilder`]: For building [`VariantArray`]
25//!
26//! # Compute Kernels
27//! - [`json_to_variant()`]: Function to convert Arrays of JSON strings to a `VariantArray`.
28//! - [`variant_to_json()`]: Function to convert a `VariantArray` to arrays of JSON strings.
29//! - [`cast_to_variant()`]: Cast Arrow arrays to `VariantArray`.
30//! - [`variant_get()`]: Convert `VariantArray` (or an inner path) to a strongly-typed Arrow array.
31//! - [`shred_variant()`]: Shred a `VariantArray` according to the provided shredding schema
32//! - [`unshred_variant()`]: Unshred a `VariantArray` to pure binary variant.
33//!
34//! ## 🚧 Work In Progress
35//!
36//! This crate is under active development and is not yet ready for production use.
37//! If you are interested in helping, you can find more information on the GitHub [Variant issue]
38//!
39//! [Variant Binary Encoding]: https://github.com/apache/parquet-format/blob/master/VariantEncoding.md
40//! [Apache Parquet]: https://parquet.apache.org/
41//! [`VariantPath`]: parquet_variant::VariantPath
42//! [Variant issue]: https://github.com/apache/arrow-rs/issues/6736
43
44mod arrow_to_variant;
45mod cast_to_variant;
46mod from_json;
47mod shred_variant;
48mod to_json;
49mod type_conversion;
50mod unshred_variant;
51mod variant_array;
52mod variant_array_builder;
53mod variant_get;
54mod variant_to_arrow;
55
56pub use variant_array::{ShreddingState, VariantArray, VariantArrayIter, VariantType};
57pub use variant_array_builder::{VariantArrayBuilder, VariantValueArrayBuilder};
58
59pub use cast_to_variant::{cast_to_variant, cast_to_variant_with_options};
60pub use from_json::json_to_variant;
61pub use shred_variant::{IntoShreddingField, ShreddedSchemaBuilder, shred_variant};
62pub use to_json::variant_to_json;
63pub use unshred_variant::unshred_variant;
64pub use variant_get::{GetOptions, variant_get};