You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2023/01/16 02:31:35 UTC

[GitHub] [calcite] zoudan commented on a diff in pull request #2981: [CALCITE-5283] Add ARG_MIN, ARG_MAX aggregate functions

zoudan commented on code in PR #2981:
URL: https://github.com/apache/calcite/pull/2981#discussion_r1070765927


##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -1849,6 +1849,17 @@ public static <T extends Comparable<T>> T greatest(T b0, T b1) {
     return b0 == null || b1 != null && b0.compareTo(b1) < 0 ? b1 : b0;
   }
 
+  /** Less than. */
+  public static <T extends Comparable<T>> boolean lessThan(T b0, T b1) {
+    return b1 == null || b0 != null && b0.compareTo(b1) < 0;
+  }
+
+  /** Grater than. */
+  public static <T extends Comparable<T>> boolean greaterThan(T b0, T b1) {
+    return b1 == null || b0 != null && b0.compareTo(b1) > 0;

Review Comment:
   `greaterThan` return wether b0 is greater than b1 while `greatest` return the larger one between b0 and b1



-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org