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 2022/01/03 18:49:25 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #3632: Core: Allow deleting and adding the same column

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



##########
File path: core/src/main/java/org/apache/iceberg/BaseUpdatePartitionSpec.java
##########
@@ -133,7 +133,9 @@ public BaseUpdatePartitionSpec addField(String name, Term term) {
     Pair<Integer, String> validationKey = Pair.of(sourceTransform.first(), sourceTransform.second().toString());
 
     PartitionField existing = transformToField.get(validationKey);
-    Preconditions.checkArgument(existing == null,
+    Preconditions.checkArgument(existing == null ||
+        (deletes.contains(existing.fieldId()) &&
+            !existing.transform().dedupName().equals(sourceTransform.second().dedupName())),

Review comment:
       `dedupName` isn't correct. It is okay to drop a `months` field and replace it with a `days` field. But the dedup name for both is `time`. Instead, this should check the `toString` of the transform to ensure it isn't an identical transform.




-- 
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-unsubscribe@iceberg.apache.org

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