liamzwbao commented on code in PR #8796:
URL: https://github.com/apache/arrow-rs/pull/8796#discussion_r2499935396
##########
parquet-variant-compute/src/shred_variant.rs:
##########
@@ -123,13 +123,39 @@ pub(crate) fn
make_variant_to_shredded_variant_arrow_row_builder<'a>(
"Shredding variant array values as arrow lists".to_string(),
));
}
- _ => {
+ // Supported shredded primitive types, see Variant shredding spec:
+ //
https://github.com/apache/parquet-format/blob/master/VariantShredding.md#shredded-value-types
+ DataType::Boolean
+ | DataType::Int8
+ | DataType::Int16
+ | DataType::Int32
+ | DataType::Int64
+ | DataType::Float32
+ | DataType::Float64
+ | DataType::Decimal32(..)
+ | DataType::Decimal64(..)
+ | DataType::Decimal128(..)
+ | DataType::Date32
+ | DataType::Time64(TimeUnit::Microsecond)
+ | DataType::Timestamp(TimeUnit::Microsecond | TimeUnit::Nanosecond, _)
+ | DataType::Binary
+ | DataType::BinaryView
+ | DataType::Utf8
+ | DataType::Utf8View
+ | DataType::FixedSizeBinary(16) // UUID
+ => {
let builder =
make_primitive_variant_to_arrow_row_builder(data_type,
cast_options, capacity)?;
let typed_value_builder =
VariantToShreddedPrimitiveVariantRowBuilder::new(builder,
capacity, top_level);
VariantToShreddedVariantRowBuilder::Primitive(typed_value_builder)
}
+ DataType::FixedSizeBinary(_) => {
+ return Err(ArrowError::InvalidArgumentError(format!("{data_type}
is not a valid variant shredding type. Only FixedSizeBinary(16) for UUID is
supported.")))
Review Comment:
I think this provides a user friendly message and it's actually moved from
`variant_to_arrow`. Don't mind removing it tho
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]