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



##########
File path: api/src/main/java/org/apache/iceberg/PartitionField.java
##########
@@ -67,6 +68,20 @@ public String name() {
     return transform;
   }
 
+  /**
+   * Returns true if this partition field is compatible with another partition 
field.
+   * <p>
+   * Partition fields are considered compatible if they have the same source 
ID, field ID and their
+   * transforms are equivalent or one of them is always producing nulls.
+   */
+  boolean compatibleWith(PartitionField other) {

Review comment:
       `PartitionSpec.compatibleWith` checks that the field names match, but 
ignores the field ID. That allows us to dedup specs that only differ by field 
IDs and avoid adding a spec that isn't needed.
   
   This checks field IDs but not field names, the opposite of the other 
`compatibleWith`. It isn't a good idea to have two different notions of 
compatibility within partitioning. I think the solution is probably to be more 
specific, like `equivalentIgnoringNames` or something. Not a great name for a 
method, but clear about what is happening. That, or we could avoid adding a 
method here.




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to