zinking commented on code in PR #6405:
URL: https://github.com/apache/iceberg/pull/6405#discussion_r1045358208
##########
api/src/main/java/org/apache/iceberg/expressions/BoundAggregate.java:
##########
@@ -44,4 +57,85 @@ public Type type() {
return term().type();
}
}
+
+ public String describe() {
+ switch (op()) {
+ case COUNT_STAR:
+ return "count(*)";
+ case COUNT:
+ return "count(" + ExpressionUtil.describe(term()) + ")";
+ case MAX:
+ return "max(" + ExpressionUtil.describe(term()) + ")";
+ case MIN:
+ return "min(" + ExpressionUtil.describe(term()) + ")";
+ default:
+ throw new UnsupportedOperationException("Unsupported aggregate type: "
+ op());
+ }
+ }
+
+ <V> V safeGet(Map<Integer, V> map, int key) {
+ return safeGet(map, key, null);
+ }
+
+ <V> V safeGet(Map<Integer, V> map, int key, V defaultValue) {
Review Comment:
should this belong to some util class or possibly null isnt allowed
--
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]