rdblue commented on code in PR #4920: URL: https://github.com/apache/iceberg/pull/4920#discussion_r896056903
########## python/src/iceberg/utils/schema_conversion.py: ########## @@ -147,7 +145,14 @@ def _resolve_union(self, type_union: dict | list | str) -> tuple[str | dict[str, else: avro_types = type_union - is_optional = "null" in avro_types + # For the Iceberg spec it is required to set the default value to null + # From https://iceberg.apache.org/spec/#avro + # Optional fields must always set the Avro field default value to null. + # + # This means that null has to come first: + # https://avro.apache.org/docs/current/spec.html + # type of the default value must match the first element of the union. + is_optional = "null" == avro_types[0] Review Comment: Nevermind, based on the comment above. I understand the limitation now. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org