Skip to main content

Module variant_array

Module variant_array 

Source
Expand description

VariantArray implementation

Re-exportsΒ§

use crate::VariantArrayBuilder; πŸ”’
use crate::type_conversion::generic_conversion_single_value; πŸ”’
use crate::type_conversion::generic_conversion_single_value_with_result; πŸ”’
use crate::type_conversion::primitive_conversion_single_value; πŸ”’
use arrow::array::Array; πŸ”’
use arrow::array::ArrayRef; πŸ”’
use arrow::array::AsArray; πŸ”’
use arrow::array::StructArray; πŸ”’
use arrow::array::StructArrayAssembler; πŸ”’
use arrow::array::downcast_dictionary_array; πŸ”’
use arrow::array::downcast_run_array; πŸ”’
use arrow::array::new_null_array; πŸ”’
use arrow::buffer::NullBuffer; πŸ”’
use arrow::compute::cast; πŸ”’
use arrow::datatypes::Date32Type; πŸ”’
use arrow::datatypes::Decimal32Type; πŸ”’
use arrow::datatypes::Decimal64Type; πŸ”’
use arrow::datatypes::Decimal128Type; πŸ”’
use arrow::datatypes::Float16Type; πŸ”’
use arrow::datatypes::Float32Type; πŸ”’
use arrow::datatypes::Float64Type; πŸ”’
use arrow::datatypes::Int8Type; πŸ”’
use arrow::datatypes::Int16Type; πŸ”’
use arrow::datatypes::Int32Type; πŸ”’
use arrow::datatypes::Int64Type; πŸ”’
use arrow::datatypes::Time64MicrosecondType; πŸ”’
use arrow::datatypes::TimestampMicrosecondType; πŸ”’
use arrow::datatypes::TimestampNanosecondType; πŸ”’
use arrow::error::Result; πŸ”’
use arrow_schema::extension::Uuid as UuidExtension; πŸ”’
use arrow_schema::ArrowError; πŸ”’
use arrow_schema::DataType; πŸ”’
use arrow_schema::Field; πŸ”’
use arrow_schema::FieldRef; πŸ”’
use arrow_schema::TimeUnit; πŸ”’
use chrono::DateTime; πŸ”’
use chrono::NaiveTime; πŸ”’
use parquet_variant::Uuid; πŸ”’
use parquet_variant::Variant; πŸ”’
use parquet_variant::VariantDecimal4; πŸ”’
use parquet_variant::VariantDecimal8; πŸ”’
use parquet_variant::VariantDecimal16; πŸ”’
use parquet_variant::VariantDecimalType as _; πŸ”’
use parquet_variant::VariantType; πŸ”’
use std::borrow::Cow; πŸ”’
use std::sync::Arc; πŸ”’

StructsΒ§

ShreddedVariantFieldArray
One shredded field of a partially or perfectly shredded variant. For example, suppose the shredding schema for variant v treats it as an object with a single field a, where a is itself a struct with the single field b of type INT. Then the physical layout of the column is:
ShreddingState
Represents the shredding state of a VariantArray
VariantArray
An array of Parquet [Variant] values
VariantArrayIter
An iterator over VariantArray

FunctionsΒ§

all_null_value_column πŸ”’
Returns an all-null binary value column of the given length.
binary_array_value πŸ”’
Returns the logical bytes at the given index from a binary-like array, resolving dictionary and run-end encodings. Returns None for nulls or if the logical values aren’t binary-like.
canonicalize_and_verify_data_type πŸ”’
Recursively visits a data type, ensuring that it only contains data types that can legally appear in a (possibly shredded) variant array. It also narrows decimal types to the smallest valid precision (e.g. Decimal128 -> Decimal32 when the precision fits).
canonicalize_and_verify_data_type_impl πŸ”’
canonicalize_and_verify_field πŸ”’
canonicalize_shredded_types πŸ”’
Canonicalize shredded typed_value fields (e.g. decimal narrowing) and verify that all data types in the struct are legal for a variant array.
typed_value_field πŸ”’
Build the typed_value [FieldRef] for a shredded column.
typed_value_to_variant πŸ”’
returns the non-null element at index as a Variant
validate_binary_array πŸ”’
Validates that an array has a binary-like data type.
validate_metadata_array πŸ”’
Validates that a metadata array has binary-like logical values.
variant_from_arrays_at πŸ”’
Returns a [Variant] from a metadata and value byte arrays, returns None if one of them is of invalid type.