impala-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcel Kornacker (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IMPALA-5083) add ORDER BY clause to GROUP_CONCAT()
Date Thu, 16 Mar 2017 23:41:41 GMT

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

Marcel Kornacker commented on IMPALA-5083:
------------------------------------------

We currently have the separator as parameter 2, so let's make the syntax with the ORDER BY
like so:

GROUP_CONCAT([DISTINCT] expr [, expr...] [ORDER BY...] [, str_val])

> add ORDER BY clause to GROUP_CONCAT()
> -------------------------------------
>
>                 Key: IMPALA-5083
>                 URL: https://issues.apache.org/jira/browse/IMPALA-5083
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Backend, Frontend
>            Reporter: Greg Rahn
>              Labels: ramp-up
>
> Currently GROUP_CONCAT() does not allow one to return an ordered result.  The MySQL version
does support this:
> {noformat}
> GROUP_CONCAT([DISTINCT] expr [,expr ...]
>              [ORDER BY {unsigned_integer | col_name | expr}
>                  [ASC | DESC] [,col_name ...]]
>              [SEPARATOR str_val])
> {noformat}
> https://dev.mysql.com/doc/refman/8.0/en/group-by-functions.html#function_group-concat
> For example:
> {noformat}
> mysql> SELECT student_name,
>     ->     GROUP_CONCAT(DISTINCT test_score
>     ->               ORDER BY test_score DESC SEPARATOR ' ')
>     ->     FROM student
>     ->     GROUP BY student_name;
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message