zeroshade commented on code in PR #2646:
URL: https://github.com/apache/iceberg-go/pull/2646#discussion_r4645695386
##########
table/update_schema.go:
##########
@@ -1129,15 +1131,28 @@ func (u *UpdateSchema) BuildUpdates() ([]Update,
[]Requirement, error) {
)
}
- if u.nameMapping != nil {
+ // Keep the table's name mapping in step with the schema, as
Java's
+ // SchemaUpdate and PyIceberg's UpdateSchema do. Otherwise
files without
+ // field IDs cannot be resolved for added or renamed columns.
+ nameMapping := u.nameMapping
+ if nameMapping == nil {
+ nameMapping = meta.NameMapping()
Review Comment:
nit: when the property can't be parsed, `NameMapping()` returns nil, so the
schema change commits and leaves the stale mapping in place with no signal.
Java at least logs a warning here. Since there's no logger to use, could a
short comment say the skip is deliberate, so it doesn't read as an oversight?
--
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]