brunomendola opened a new issue, #12223: URL: https://github.com/apache/iceberg/issues/12223
### Apache Iceberg version 1.5.0 ### Query engine Spark ### Please describe the bug 🐞 Currently we cannot add the parent field with its child nested field in the same transaction. For example, ``` updateSchema.addColumn("myparent", parentType) updateSchema.addColumn("myparent", "mychild", childType) ``` results in the error `IllegalArgumentException: cannot find parent struct: myparent` This exception is caused by the check in `SchemaUpdate#internalAddColumn`, which calls `findField(parent)`, that in turn checks in `this.schema`, which contains only the committed changes. The uncommitted changes are in `this.adds` instead. This is the exact same issue that is also present in the Python implementation: https://github.com/apache/iceberg-python/issues/1493 ### Willingness to contribute - [ ] I can contribute a fix for this bug independently - [ ] I would be willing to contribute a fix for this bug with guidance from the Iceberg community - [ ] I cannot contribute a fix for this bug at this time -- 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.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