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Β§
- Shredded
Variant Field Array - One shredded field of a partially or perfectly shredded variant. For example, suppose the
shredding schema for variant
vtreats it as an object with a single fielda, whereais itself a struct with the single fieldbof type INT. Then the physical layout of the column is: - Shredding
State - Represents the shredding state of a
VariantArray - Variant
Array - An array of Parquet [
Variant] values - Variant
Array Iter - An iterator over
VariantArray
FunctionsΒ§
- all_
null_ πvalue_ column - Returns an all-null binary
valuecolumn 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
Nonefor 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 ametadataandvaluebyte arrays, returnsNoneif one of them is of invalid type.