c-thiel commented on code in PR #2840:
URL: https://github.com/apache/iceberg-rust/pull/2840#discussion_r3612606807


##########
crates/iceberg/src/arrow/schema.rs:
##########
@@ -544,6 +569,21 @@ impl ArrowSchemaVisitor for ArrowSchemaConverter {
             )),
         }
     }
+
+    fn variant(&mut self, field: &FieldRef) -> Result<Self::T> {
+        // The extension may only sit on struct storage (mirrors
+        // `VariantExtensionType::supports_data_type`).
+        if !matches!(field.data_type(), DataType::Struct(_)) {

Review Comment:
   I thought about this too - my main reasons for not matching the nested types 
are:
   1. I believe when we use shredding the storage has typed value fields, not 
just `{metadata, value}`
   1. It mirrors Java (which isn't necessarily a good reason though): 
`MessageTypeToType.variant()` returns `VariantType.get()` and 
`ParquetTypeVisitor` short-circuits the group without validating its children; 
structural checks are deferred to read time.
   1. Recognition's job is "is this a Variant?" — the extension answers that. 
Validating we can actually read the storage (and rejecting shredded for now) 
belongs in the read PR



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to