You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/02/08 18:06:25 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #2204: Allow adding of deleted columns

rdblue commented on a change in pull request #2204:
URL: https://github.com/apache/iceberg/pull/2204#discussion_r572258383



##########
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 ||
+                      deletes.contains(schema.findField(parent + "." + name).fieldId()),

Review comment:
       Nit: indentation is 2 indents (4 spaces) from the previous line.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org