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/01/16 23:10:22 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #2061: Improve partition spec builder

rdblue commented on a change in pull request #2061:
URL: https://github.com/apache/iceberg/pull/2061#discussion_r559050950



##########
File path: api/src/main/java/org/apache/iceberg/PartitionSpec.java
##########
@@ -319,7 +319,7 @@ public static Builder builderFor(Schema schema) {
     private final Schema schema;
     private final List<PartitionField> fields = Lists.newArrayList();
     private final Set<String> partitionNames = Sets.newHashSet();
-    private Map<Integer, PartitionField> timeFields = Maps.newHashMap();
+    private Map<String, PartitionField> partitionFields = Maps.newHashMap();

Review comment:
       I like this implementation because it allows easily adding new checks. I agree that the name could be better, like `dedupFields` or `dedupPartitionFields` as Jack suggested. I would not combine this with `fields`. I think that would make both too difficult to reason about.
   
   One more thing I would change is to make the key a `Pair<Integer, String>` instead of a `String` That avoids confusion about how to create the keys, and also prevents unnecessary collisions like `(1, p1)` with `(11, p)`.




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