blackmwk commented on code in PR #2773:
URL: https://github.com/apache/iceberg-rust/pull/2773#discussion_r3977148240


##########
crates/iceberg/src/spec/datatypes.rs:
##########
@@ -637,6 +644,77 @@ impl From<NestedField> for SerdeNestedField {
 pub type NestedFieldRef = Arc<NestedField>;
 
 impl NestedField {
+    pub(crate) fn validate_unknown_type(&self) -> Result<()> {

Review Comment:
   Lets wait for #3182 to be resolved and add this later.



##########
crates/iceberg/src/arrow/reader/pipeline.rs:
##########


Review Comment:
   Is this related to this issue?



##########
crates/iceberg/src/arrow/reader/row_lineage.rs:
##########


Review Comment:
   Ditto.



##########
crates/iceberg/src/avro/schema.rs:
##########
@@ -74,7 +74,7 @@ impl SchemaVisitor for SchemaToAvroSchema {
             record.name = Name::from(format!("r{}", field.id).as_str());
         }
 
-        if !field.required {
+        if !field.required && !is_avro_null(&field_schema) {

Review Comment:
   ```suggestion
           if !field.required  {
             if !is_avro_null(xx) {
                  field_schema = avro_optional(field_schema)?;
             } else {
                 // explain why we cant use union
                  filed_schema = Avro::Null;
              }
   ```
   This is a little difficult to read, how about changing it to above?



##########
crates/iceberg/src/avro/schema.rs:
##########
@@ -311,6 +312,10 @@ pub(crate) fn avro_decimal_schema(precision: usize, scale: 
usize) -> Result<Avro
 }
 
 fn avro_optional(avro_schema: AvroSchema) -> Result<AvroSchema> {
+    if is_avro_null(&avro_schema) {

Review Comment:
   Remove this special case.



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