Skip to content
Prev Previous commit
Next Next commit
comment
  • Loading branch information
scovich committed Sep 24, 2025
commit 54056fe6fda1561a18108c0a1ed45db903e6ab74
5 changes: 4 additions & 1 deletion parquet-variant-compute/src/variant_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,9 +868,11 @@ fn cast_to_binary_view_arrays(array: &dyn Array) -> Result<ArrayRef, ArrowError>
cast(array, new_type.as_ref())
}

/// Validates whether a given arrow decimal is a valid variant decimal
fn is_valid_variant_decimal(p: &u8, s: &i8, max_precision: u8) -> bool {
*p <= max_precision && (0..=*p as i8).contains(s)
}

/// replaces all instances of Binary with BinaryView in a DataType
fn canonicalize_and_verify_data_type(
data_type: &DataType,
Expand Down Expand Up @@ -913,7 +915,8 @@ fn canonicalize_and_verify_data_type(
Date32 | Time64(TimeUnit::Microsecond) => borrow!(),
Date64 | Time32(_) | Time64(_) | Duration(_) | Interval(_) => fail!(),

// Binary and string are allowed
// Binary and string are allowed.
// NOTE: We force Binary to BinaryView because that's what the parquet reader returns.
Binary => Cow::Owned(DataType::BinaryView),
BinaryView | Utf8 => borrow!(),

Expand Down
Loading