rdblue commented on a change in pull request #845: Add persistent IDs to 
partition fields
URL: https://github.com/apache/incubator-iceberg/pull/845#discussion_r403221964
 
 

 ##########
 File path: api/src/main/java/org/apache/iceberg/PartitionSpec.java
 ##########
 @@ -437,24 +447,30 @@ public Builder truncate(String sourceName, int width, 
String targetName) {
       checkAndAddPartitionName(targetName);
       Types.NestedField sourceColumn = findSourceColumn(sourceName);
       fields.add(new PartitionField(
-          sourceColumn.fieldId(), targetName, 
Transforms.truncate(sourceColumn.type(), width)));
+          sourceColumn.fieldId(), nextFieldId(), targetName, 
Transforms.truncate(sourceColumn.type(), width)));
       return this;
     }
 
     public Builder truncate(String sourceName, int width) {
       return truncate(sourceName, width, sourceName + "_trunc");
     }
 
-    Builder add(int sourceId, String name, String transform) {
+    // add a partition field with an auto-increment partition field id 
starting from PARTITION_DATA_ID_START
+    Builder append(int sourceId, String name, String transform) {
 
 Review comment:
   Why rename this to `append`? What about `addWithoutId` or just overload 
`add`?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to