You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2020/10/21 23:29:00 UTC

[jira] [Created] (CALCITE-4349) Support GROUP_CONCAT aggregate function for MySQL

Julian Hyde created CALCITE-4349:
------------------------------------

             Summary: Support GROUP_CONCAT aggregate function for MySQL
                 Key: CALCITE-4349
                 URL: https://issues.apache.org/jira/browse/CALCITE-4349
             Project: Calcite
          Issue Type: Bug
            Reporter: Julian Hyde


Support GROUP_CONCAT aggregate function for MySQL. Here is the syntax:
{noformat}
GROUP_CONCAT([DISTINCT] expr [,expr ...]
             [ORDER BY {unsigned_integer | col_name | expr}
                 [ASC | DESC] [,col_name ...]]
             [SEPARATOR str_val])
{noformat}

It is analogous to {{LISTAGG}} (see CALCITE-2754) (and also to BigQuery and PostgreSQL's {{STRING_AGG}}, see CALCITE-4335). For example, the query
{code}
SELECT deptno, GROUP_CONCAT(ename ORDER BY empno SEPARATOR ';')
FROM Emp
GROUP BY deptno
{code}
is equivalent to (and in Calcite's algebra would be desugared to)
{code}
SELECT deptno, LISTAGG(ename, ';') WITHIN GROUP (ORDER BY empno)
FROM Emp
GROUP BY deptno
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)