Expand description
Module for transforming a typed arrow Array to VariantArray.
Re-exportsΒ§
use arrow::array::ArrowNativeTypeOp;πuse arrow::compute::kernels::cast_utils::parse_decimal;πuse arrow::compute::CastOptions;πuse arrow::compute::DecimalCast;πuse arrow::compute::cast_num_to_bool;πuse arrow::compute::cast_single_string_to_boolean_default;πuse arrow::compute::float_to_decimal_opt;πuse arrow::compute::num_cast;πuse arrow::compute::rescale_decimal;πuse arrow::compute::single_bool_to_numeric;πuse arrow::compute::single_decimal_to_float_lossy;πuse arrow::datatypes;πuse arrow::datatypes::ArrowPrimitiveType;πuse arrow::datatypes::ArrowTimestampType;πuse arrow::datatypes::Decimal32Type;πuse arrow::datatypes::Decimal64Type;πuse arrow::datatypes::Decimal128Type;πuse arrow::datatypes::Decimal256Type;πuse arrow::datatypes::DecimalType;πuse arrow::error::ArrowError;πuse arrow::error::Result;πuse chrono::DateTime;πuse chrono::NaiveDate;πuse chrono::NaiveDateTime;πuse chrono::NaiveTime;πuse chrono::Timelike;πuse chrono::Utc;πuse half::f16;πuse num_traits::NumCast;πuse parquet_variant::Variant;πuse parquet_variant::VariantDecimal4;πuse parquet_variant::VariantDecimal8;πuse parquet_variant::VariantDecimal16;πpub(crate) use non_generic_conversion_single_value;πpub(crate) use generic_conversion_single_value;πpub(crate) use generic_conversion_single_value_with_result;πpub(crate) use primitive_conversion_single_value;π
MacrosΒ§
- generic_
conversion_ πsingle_ value - Convert the value at a specific index in the given array into a
Variant, usingmethodrequiring a generic type to downcast the generic array to a specific array type andcast_fnto transform the element. - generic_
conversion_ πsingle_ value_ with_ result - impl_
decimal_ πcast_ target - impl_
primitive_ πfrom_ variant - Macro to generate PrimitiveFromVariant implementations for Arrow primitive types
- impl_
timestamp_ πfrom_ variant - non_
generic_ πconversion_ single_ value - Convert the value at a specific index in the given array into a
Variant. - primitive_
conversion_ πsingle_ value - Convert the value at a specific index in the given array into a
Variant.
EnumsΒ§
- Numeric
Kind π - Variant
Cast πMode - Controls the conversions allowed when extracting a typed value from a variant.
TraitsΒ§
- Decimal
Cast πTarget - Primitive
From πVariant - Extension trait for Arrow primitive types that can extract their native value from a Variant
- Shred
Decimal πVariant - Timestamp
From πVariant - Extension trait for Arrow timestamp types that can extract their native value from a Variant
We canβt use
PrimitiveFromVariantdirectly because we need two implementations for each timestamp type β theNTZparam here.
FunctionsΒ§
- always_
none π - as_num π
- Converts a boolean or numeric variant(integers, floating-point, and decimals)
to the specified numeric type
T. - cast_
decimal_ πto_ num - cast_
naive_ πdate - cast_
time_ πutc - convert_
to_ πtimestamp_ nano - convert_
to_ πtimestamp_ ntz_ nano - convert_
to_ πunscaled_ decimal - shred_
variant_ πto_ unscaled_ decimal - Returns the unscaled integer representation for Arrow decimal type
Ofrom aVariant. - variant_
cast_ πwith_ options - Cast a single
Variantvalue with safe/strict semantics. - variant_
to_ πboolean - variant_
to_ πunscaled_ decimal - Returns the unscaled integer representation for Arrow decimal type
Ofrom aVariant.