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 2021/07/13 17:25:34 UTC

[GitHub] [calcite] amaliujia commented on a change in pull request #2447: [CALCITE-4661]Add MODE aggregate function(NobiGo)

amaliujia commented on a change in pull request #2447:
URL: https://github.com/apache/calcite/pull/2447#discussion_r668968983



##########
File path: core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java
##########
@@ -952,6 +952,16 @@
    */
   public static final SqlAggFunction COUNT = new SqlCountAggFunction("COUNT");
 
+  /**
+   * <code>MODE</code> aggregate function.
+   */
+  public static final SqlAggFunction MODE =
+      SqlBasicAggFunction
+          .create("MODE", SqlKind.MODE,
+              ReturnTypes.ARG0_NULLABLE_IF_EMPTY, OperandTypes.ANY_NOT_NULL)

Review comment:
       In the JIRA discussion, I see that MODE allows NULL but if NULL is the most common value, return the second most common value instead. Why you choose to does not allow now in type?




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