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 2020/01/05 08:20:21 UTC

[GitHub] [incubator-iceberg] manishmalhotrawork commented on a change in pull request #499: Add persistent IDs to partition fields (WIP)

manishmalhotrawork commented on a change in pull request #499: Add persistent IDs to partition fields (WIP)
URL: https://github.com/apache/incubator-iceberg/pull/499#discussion_r363076834
 
 

 ##########
 File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
 ##########
 @@ -312,15 +314,20 @@ public TableMetadata updatePartitionSpec(PartitionSpec newPartitionSpec) {
     Preconditions.checkArgument(defaultSpecId != newDefaultSpecId,
         "Cannot set default partition spec to the current default");
 
+    // start from last partition spec's fieldId
+    AtomicInteger nextPartitionFieldId = new AtomicInteger(lastPartitionFieldId);
     ImmutableList.Builder<PartitionSpec> builder = ImmutableList.<PartitionSpec>builder()
         .addAll(specs);
     if (!specsById.containsKey(newDefaultSpecId)) {
       // get a fresh spec to ensure the spec ID is set to the new default
-      builder.add(freshSpec(newDefaultSpecId, schema, newPartitionSpec));
+      PartitionSpec freshSpec = freshSpecWithAssignIds(newDefaultSpecId, schema, schema, newPartitionSpec,
+          nextPartitionFieldId, partitionFieldIdByColumnName);
 
 Review comment:
   @rdblue 
   are we referring to this
   `Schema freshSchema = TypeUtil.assignFreshIds(schema, lastColumnId::incrementAndGet);`
   
   as `TypeUtil.assignFreshIds` assign id to the schema ?
   

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


With regards,
Apache Git Services

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