RussellSpitzer commented on code in PR #10862: URL: https://github.com/apache/iceberg/pull/10862#discussion_r1703598014
########## core/src/main/java/org/apache/iceberg/SchemaUpdate.java: ########## @@ -201,6 +204,8 @@ public UpdateSchema renameColumn(String name, String newName) { Types.NestedField field = findField(name); Preconditions.checkArgument(field != null, "Cannot rename missing column: %s", name); Preconditions.checkArgument(newName != null, "Cannot rename a column to null"); + Preconditions.checkArgument( + !renamedNameToId.containsKey(newName), "Cannot rename columns to same name: %s", newName); Review Comment: Just wondering in general what we want to support here. Thinking about usages like ``` update.rename("a", "b").rename("b", "c").rename("c", "d").rename("x", "b") ``` Should this be allowed? -- 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