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//! [`VariantArray`] and compute kernels for the [Variant Binary Encoding] from [Apache Parquet].
19//!
20//! ## Main APIs
21//! - [`VariantArray`] : Represents an array of `Variant` values.
22//! - [`VariantArrayBuilder`]: For building [`VariantArray`]
23//!
24//! # Compute Kernels
25//! - [`json_to_variant()`]: Function to convert Arrays of JSON strings to a `VariantArray`.
26//! - [`variant_to_json()`]: Function to convert a `VariantArray` to arrays of JSON strings.
27//! - [`cast_to_variant()`]: Cast Arrow arrays to `VariantArray`.
28//! - [`variant_get()`]: Convert `VariantArray` (or an inner path) to a strongly-typed Arrow array.
29//! - [`shred_variant()`]: Shred a `VariantArray` according to the provided shredding schema
30//! - [`unshred_variant()`]: Unshred a `VariantArray` to pure binary variant.
31//!
32//! ## 🚧 Work In Progress
33//!
34//! This crate is under active development and is not yet ready for production use.
35//! If you are interested in helping, you can find more information on the GitHub [Variant issue]
36//!
37//! [Variant Binary Encoding]: https://github.com/apache/parquet-format/blob/master/VariantEncoding.md
38//! [Apache Parquet]: https://parquet.apache.org/
39//! [`VariantPath`]: parquet_variant::VariantPath
40//! [Variant issue]: https://github.com/apache/arrow-rs/issues/6736
41
42mod arrow_to_variant;
43mod cast_to_variant;
44mod from_json;
45mod shred_variant;
46mod to_json;
47mod type_conversion;
48mod unshred_variant;
49mod variant_array;
50mod variant_array_builder;
51mod variant_get;
52mod variant_to_arrow;
53
54pub use variant_array::{BorrowedShreddingState, ShreddingState, VariantArray, VariantType};
55pub use variant_array_builder::{VariantArrayBuilder, VariantValueArrayBuilder};
56
57pub use cast_to_variant::{cast_to_variant, cast_to_variant_with_options};
58pub use from_json::json_to_variant;
59pub use shred_variant::shred_variant;
60pub use to_json::variant_to_json;
61pub use type_conversion::CastOptions;
62pub use unshred_variant::unshred_variant;
63pub use variant_get::{GetOptions, variant_get};