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



##########
File path: core/src/test/resources/sql/agg.iq
##########
@@ -2990,4 +2990,146 @@ from (select 1 as a, 2 as b, 3 as c);
 
 !ok
 
+# [CALCITE-3661] Add MODE aggregate function
+
+# mode function applied to input value and return the most frequent value.
+select MODE(gender)
+from emp;
++--------+
+| EXPR$0 |
++--------+
+| F      |
++--------+
+(1 row)
+
+!ok
+
+# mode function applied to distinct value and return the first input value.
+select MODE(distinct gender)
+from emp;
++--------+
+| EXPR$0 |
++--------+
+| F      |
++--------+
+(1 row)
+
+!ok
+
+# mode function applied to filter and input value is not NULL.
+select MODE(gender)
+from emp
+where deptno <= 20;
++--------+
+| EXPR$0 |
++--------+
+| M      |
++--------+
+(1 row)
+
+!ok
+
+# mode function applied to filter and input value is NULL.
+select MODE(gender)
+from emp
+where deptno > 60;
++--------+
+| EXPR$0 |
++--------+
+|        |
++--------+

Review comment:
       @amaliujia If you have any other advice,  please let me know. Then we 
can make some progress.




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


Reply via email to