CTTY commented on code in PR #2188:
URL: https://github.com/apache/iceberg-rust/pull/2188#discussion_r2956941055


##########
crates/iceberg/src/avro/schema.rs:
##########
@@ -220,6 +221,39 @@ impl SchemaVisitor for SchemaToAvroSchema {
         }
     }
 
+    fn variant(&mut self, _v: &VariantType) -> Result<AvroSchemaOrField> {
+        let fields = vec![
+            AvroRecordField {
+                name: "metadata".to_string(),
+                schema: AvroSchema::Bytes,
+                order: RecordFieldOrder::Ignore,
+                position: 0,
+                doc: None,
+                aliases: None,
+                default: None,
+                custom_attributes: Default::default(),
+            },
+            AvroRecordField {
+                name: "value".to_string(),
+                schema: AvroSchema::Bytes,
+                order: RecordFieldOrder::Ignore,
+                position: 1,
+                doc: None,
+                aliases: None,
+                default: None,
+                custom_attributes: Default::default(),
+            },
+        ];
+        let mut schema = avro_record_schema(VARIANT_LOGICAL_TYPE, fields)?;

Review Comment:
   I don't think we can use a static string for every record. what if there are 
multiple variant columns, would the record name conflict?



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