tweise opened a new issue #3005:
URL: https://github.com/apache/iceberg/issues/3005


   Optional columns are added as union types 
`["null",{"type":"record","name":"rnull","fields":[...]}]` and in case of 
multiple such additions, the resulting schema will be invalid due to repetition 
of the nested record schema with name `"rnull"` and namespace `null`.  
   
   Projected schema is invalid and fails toString conversion with:
   
   ```
   Exception: org.apache.avro.SchemaParseException: Can't redefine: rnull
        at org.apache.avro.Schema$Names.put(Schema.java:1547)
        at org.apache.avro.Schema$NamedSchema.writeNameRef(Schema.java:810)
        at org.apache.avro.Schema$RecordSchema.toJson(Schema.java:972)
        at org.apache.avro.Schema$UnionSchema.toJson(Schema.java:1239)
        at org.apache.avro.Schema$RecordSchema.fieldsToJson(Schema.java:1000)
        at org.apache.avro.Schema$RecordSchema.toJson(Schema.java:984)
        at org.apache.avro.Schema.toString(Schema.java:424)
        at org.apache.avro.Schema.toString(Schema.java:396)
        at org.apache.avro.Schema.toString(Schema.java:387)
   ```
   
   I was able to work around the issue by setting a unique name space for these 
schemas.
   


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