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/05/09 07:08:53 UTC

[GitHub] [iceberg] jun-he opened a new issue #2569: Error when dropping partition fields for the same source field more than once.

jun-he opened a new issue #2569:
URL: https://github.com/apache/iceberg/issues/2569


   ```
       sql("CREATE TABLE testTable (id bigint NOT NULL, ts timestamp, data string) USING iceberg");
       sql("ALTER TABLE testTable ADD PARTITION FIELD bucket(16, id)");
       sql("ALTER TABLE testTable DROP PARTITION FIELD bucket(16, id)");
       sql("ALTER TABLE testTable ADD PARTITION FIELD truncate(id, 4)");
       sql("ALTER TABLE testTable DROP PARTITION FIELD truncate(id, 4)");
       sql("ALTER TABLE testTable ADD PARTITION FIELD years(ts)");
   ```
   will throw an error
   ```
       java.lang.IllegalArgumentException: Multiple entries with same key: (1, void)=1001: id_trunc_4: void(1) and (1, void)=1000: shard: void(1)
           at org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap.conflictException(ImmutableMap.java:214)
           at org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:208)
           at org.apache.iceberg.relocated.com.google.common.collect.RegularImmutableMap.checkNoConflictInKeyBucket(RegularImmutableMap.java:146)
           at org.apache.iceberg.relocated.com.google.common.collect.RegularImmutableMap.fromEntryArray(RegularImmutableMap.java:109)
           at org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:392)
           at org.apache.iceberg.BaseUpdatePartitionSpec.indexSpecByTransform(BaseUpdatePartitionSpec.java:296)
           at org.apache.iceberg.BaseUpdatePartitionSpec.<init>(BaseUpdatePartitionSpec.java:71)
   ......
   ```
   When doing `indexSpecByTransform` within `BaseUpdatePartitionSpec`, `VoidTransform` probably should be skipped.
   


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