Shruthirdy commented on code in PR #2714:
URL: https://github.com/apache/iceberg-go/pull/2714#discussion_r4723180367


##########
table/update_schema.go:
##########
@@ -654,9 +673,51 @@ func (u *UpdateSchema) findFieldForMove(name string) (int, 
bool) {
        if ok {
                return field.ID, true
        }
-       id, ok := u.addedNameToID[name]
 
-       return id, ok
+       return u.addedFieldID(name)
+}
+
+// addedFieldID returns the ID of a column added earlier in this update,
+// matching the name with UpdateSchema's case sensitivity. AddColumn rejects
+// names that differ only in case, so at most one matches.
+func (u *UpdateSchema) addedFieldID(name string) (int, bool) {
+       if id, ok := u.addedNameToID[name]; ok {
+               return id, true
+       }
+       for addedName, id := range u.addedNameToID {

Review Comment:
   Done. `addedNameToID` is now keyed by the case-normalised name, as Java's 
`caseSensitivityAwareName` does



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