[feature](nereids) support syntax: count(all *) (#15376)

This commit is contained in:
minghong
2022-12-28 11:09:56 +08:00
committed by GitHub
parent f8bb8c7829
commit d05f430ca2
3 changed files with 8 additions and 1 deletions

View File

@ -296,7 +296,7 @@ primaryExpression
| constant #constantDefault
| ASTERISK #star
| qualifiedName DOT ASTERISK #star
| identifier LEFT_PAREN (DISTINCT? arguments+=expression
| identifier LEFT_PAREN ((DISTINCT|ALL)? arguments+=expression
(COMMA arguments+=expression)*)? RIGHT_PAREN #functionCall
| LEFT_PAREN query RIGHT_PAREN #subqueryExpression
| identifier #columnReference

View File

@ -2,6 +2,9 @@
-- !count_all --
10
-- !count_all --
10
-- !count_all_group_by --
2
2
@ -120,6 +123,9 @@ name_4 1 4
-- !count_all --
10
-- !count_all --
10
-- !count_all_group_by --
2
2

View File

@ -45,6 +45,7 @@ suite("aggregate_strategies") {
sql "SET enable_nereids_planner=true"
sql "SET enable_fallback_to_original_planner=false"
order_qt_count_all "select count(ALL *) from $tableName"
order_qt_count_all "select count(*) from $tableName"
order_qt_count_all_group_by "select count(*) from $tableName group by id"
order_qt_count_all_group_by_2 "select count(*) from $tableName group by id, name"