zeroshade commented on code in PR #1688:
URL: https://github.com/apache/iceberg-go/pull/1688#discussion_r3732111537
##########
table/update_schema.go:
##########
@@ -320,6 +320,10 @@ func (u *UpdateSchema) addColumn(path []string, fieldType
iceberg.Type, doc stri
}
parentID = parentField.ID
+
+ if u.isDeleted(parentID) {
Review Comment:
This checks only the immediate parent. If `outer` is staged for deletion and
the add targets `outer.inner.new_leaf`, `parentID` is `inner`, so this passes
and the later schema application silently discards the requested addition with
`outer`. **Suggested fix:** walk all ancestors of the resolved parent, reject
if any is staged for deletion, and report the actual deleted ancestor.
##########
table/update_schema.go:
##########
@@ -746,6 +750,10 @@ func (u *UpdateSchema) unionAddColumn(path []string,
newField iceberg.NestedFiel
}
parentID = parentField.ID
+
+ if u.isDeleted(parentID) {
Review Comment:
`UnionByNameWith` has the same immediate-parent gap: an addition below a
descendant of a deleted ancestor is accepted and then silently lost.
**Suggested fix:** apply the same full ancestor-deletion check here and report
the deleted ancestor rather than only the immediate parent path.
--
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]