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

 ##########
 File path: core/src/main/java/org/apache/iceberg/TableMetadataParser.java
 ##########
 @@ -240,6 +242,12 @@ static TableMetadata fromJson(TableOperations ops, 
InputFile file, JsonNode node
       specs = ImmutableList.of(PartitionSpecParser.fromJsonFields(
           schema, TableMetadata.INITIAL_SPEC_ID, node.get(PARTITION_SPEC)));
     }
+    // get the last spec
+    List<PartitionField> fields = specs.get(specs.size() - 1).fields();
+    if (fields.size() > 0) {
+      // get the last lastPartitionFieldId
+      lastAssignedPartitionFieldId = fields.get(fields.size() - 1).fieldId();
 
 Review comment:
   Instead of getting the last ID, I think this should just keep track of the 
last assigned partition field ID, like the `last-column-id`. How about storing 
it as `last-partition-id`?

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


With regards,
Apache Git Services

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

Reply via email to