[ 
https://issues.apache.org/jira/browse/CALCITE-4349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17262969#comment-17262969
 ] 

Julian Hyde commented on CALCITE-4349:
--------------------------------------

I re-created your commit history in 
[julianhyde/4349-group-concat|https://github.com/julianhyde/calcite/tree/4349-group-concat].

Review:
* Should be {{allowsSeparator}} not {{allowSeparator}}, to be consistent, and 
as I asked
* Add the field in SqlBasicAggFunction, not SqlAggFunction. A new constructor 
is unnecessarily disruptive.
* {{stripedCall}} should be {{strippedCall}}
* only strip separator if syntax is ORDERED_FUNCTION 
* space after '//'
* '{{i++}}' rather than '{{i += 1}}'
* fix javadoc as I asked previously
* the comment 'group_concat(deptno, ename order by ename separator ';') as 
separated_name not supported as list_agg doesn't support it either' is 
confusing. It doesn't describe what the test is doing.

> 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
>            Assignee: Zhen Wang
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Support the {{GROUP_CONCAT}} aggregate function for MySQL. Here is the 
> [syntax|https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_group-concat]:
> {noformat}
> GROUP_CONCAT([DISTINCT] expr [,expr ...]
>              [ORDER BY {unsigned_integer | col_name | expr}
>                  [ASC | DESC] [,col_name ...]]
>              [SEPARATOR str_val])
> {noformat}
>  
> {{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
> {code:java}
> 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:java}
> 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)

Reply via email to