rdblue commented on code in PR #6981:
URL: https://github.com/apache/iceberg/pull/6981#discussion_r1155366539


##########
api/src/main/java/org/apache/iceberg/expressions/ExpressionUtil.java:
##########
@@ -156,6 +158,19 @@ public static boolean selectsPartitions(
         caseSensitive);
   }
 
+  public static boolean isPartitionCol(BoundGroupBy expr, Table table) {
+    return table.specs().values().stream().allMatch(spec -> 
isPartitionCol(expr, spec));
+  }
+
+  public static boolean isPartitionCol(BoundGroupBy expr, PartitionSpec spec) {

Review Comment:
   This isn't correct. This will return all partition fields for a given ID, 
but those fields may include a transform. For example, a field could represent 
`hours(ts)` where `ts` has id 3. In order to check whether this is a partition 
column you can group by directly, you'd need to check that the transform is the 
identity transform.



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