Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Support the GROUP_CONCAT aggregate function for MySQL. Here is the syntax:
GROUP_CONCAT([DISTINCT] expr [,expr ...] [ORDER BY {unsigned_integer | col_name | expr} [ASC | DESC] [,col_name ...]] [SEPARATOR str_val])
GROUP_CONCAT is analogous to LISTAGG (see CALCITE-2754) (and also to BigQuery and PostgreSQL's STRING_AGG, see CALCITE-4335). For example, the query
SELECT deptno, GROUP_CONCAT(ename ORDER BY empno SEPARATOR ';')
FROM Emp
GROUP BY deptno
is equivalent to (and in Calcite's algebra would be desugared to)
SELECT deptno, LISTAGG(ename, ';') WITHIN GROUP (ORDER BY empno)
FROM Emp
GROUP BY deptno
Attachments
Issue Links
- Blocked
-
CALCITE-5163 MysqlSqlDialect unparse LISTAGG aggregate function error
- Closed
- relates to
-
CALCITE-4335 Aggregate functions for BigQuery
- Closed
-
CALCITE-2754 LISTAGG support
- Closed
- links to