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/13 11:24:24 UTC

[GitHub] [iceberg] PiyushHurpadeDremio opened a new issue #2589: Partition Spec Evolution

PiyushHurpadeDremio opened a new issue #2589:
URL: https://github.com/apache/iceberg/issues/2589


   I am trying to do Partition Spec update on V1 table. but commit is failing.
   So in code snippet below third operation fails. when we are adding "data" field back. This steps seems to be valid. and also it fails in commit stage so I think its valid operation to do. we must have way to update "nullTransform" with updated one for previously delete field, when we are adding it back to partition spec.
    
   ```
   System.out.println(table.spec().partitionType());
   table.updateSpec().addField("data").commit();   //Add "data"
   System.out.println(table.spec().partitionType());
   table.updateSpec().removeField("data").commit(); //Remove "data"
   System.out.println(table.spec().partitionType());
   table.updateSpec().addField("data").commit(); //Add "data" back
   System.out.println(table.spec().partitionType());
   ```
   
   See unit test for more clarity : https://github.com/PiyushHurpadeDremio/iceberg/blob/d5c9c45ff3576dd76695012c136fa6da1655a194/core/src/test/java/org/apache/iceberg/TestUpdatePartitionSpec.java#L428
   
   Error We get for V1 : 
   ```
   Cannot use partition name more than once: category
   java.lang.IllegalArgumentException: Cannot use partition name more than once: category
   	at org.apache.iceberg.relocated.com.google.common.base.Preconditions.checkArgument(Preconditions.java:217)
   	at org.apache.iceberg.PartitionSpec$Builder.checkAndAddPartitionName(PartitionSpec.java:353)
   	at org.apache.iceberg.PartitionSpec$Builder.add(PartitionSpec.java:495)
   	at org.apache.iceberg.BaseUpdatePartitionSpec.apply(BaseUpdatePartitionSpec.java:238)
   	at org.apache.iceberg.TestUpdatePartitionSpec.testAddDeleteAddName(TestUpdatePartitionSpec.java:439)
   
   ```


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