RussellSpitzer commented on issue #15086:
URL: https://github.com/apache/iceberg/issues/15086#issuecomment-3774525776

   I think there is a bug in the test code you submitted
   
   ```java
       /**
        * Shredding function: only 'id' field goes to typed_value.
        * 'name' and 'city' should remain in binary value.
        */
       private static Type shreddedType(int fieldId, String name) {
           return org.apache.parquet.schema.Types.optionalGroup() // I think 
this should be required, but I don't think it's an issue
                   .id(fieldId) ////////// This is assigning the Variant's 
field id to the typed value structure which may be messing up the writing, it 
would end up having the same field ID as the parent variant .. . surprised this 
isn't throwing an error
                   .addField(shreddedField("id",
                           
org.apache.parquet.schema.Types.optional(PrimitiveTypeName.BINARY).named("value"),
                           
org.apache.parquet.schema.Types.optional(PrimitiveTypeName.INT64).named("typed_value")))
                   .named("typed_value");
       }
       
       private static Type shreddedField(String fieldName, Type valueField, 
Type typedValueField) {
           return org.apache.parquet.schema.Types.optionalGroup()
                   .addField(valueField)
                   .addField(typedValueField)
                   .named(fieldName);
       }
   ```


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