rdblue commented on a change in pull request #2204:
URL: https://github.com/apache/iceberg/pull/2204#discussion_r572259656
##########
File path: core/src/main/java/org/apache/iceberg/SchemaUpdate.java
##########
@@ -138,12 +138,13 @@ private void internalAddColumn(String parent, String
name, boolean isOptional, T
parentId = parentField.fieldId();
Preconditions.checkArgument(!deletes.contains(parentId),
"Cannot add to a column that will be deleted: %s", parent);
- Preconditions.checkArgument(schema.findField(parent + "." + name) ==
null,
- "Cannot add column, name already exists: %s.%s", parent, name);
+ Preconditions.checkArgument(schema.findField(parent + "." + name) ==
null ||
Review comment:
I'd like to see `schema.findField(parent + "." + name)` factored out
into a variable so it isn't looked up twice.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]