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


##########
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(),
+            },
+        ];

Review Comment:
   Would you use `LazyLock<Vec<AvroRecordField>>` plus clone? 
`avro_record_schema` consumes the Vec<AvroRecordField> by value (it builds a 
RecordSchema), so each call needs its own owned copy regardless. Not sure if 
this would gain much. 



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