friendlymatthew commented on code in PR #8796:
URL: https://github.com/apache/arrow-rs/pull/8796#discussion_r2535743361


##########
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 took a closer look and I think in order to check for an extension type 
here, we'd need to plumb `FieldRef` all the way from `shred_variant`
   
   Meaning `shred_variant`'s header go from: 
   ```rs
    shred_variant(array: &VariantArray, as_type: &DataType) -> 
Result<VariantArray> {}
   ```
   
   to
   ```rs
    shred_variant(array: &VariantArray, field_ref: &FieldRef) -> 
Result<VariantArray> {}
   ```



-- 
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]

Reply via email to