[ 
https://issues.apache.org/jira/browse/CALCITE-2786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hongze Zhang updated CALCITE-2786:
----------------------------------
    Description: 
Both Oracle[1] and SQL:2016[2] supports or introduces an optional order by 
clause in JSON_ARRAYAGG, the feature can be implemented since Calcite already 
supports sorted aggregation.

AFAICS, JSON_ARRAYAGG's order by clause has no difference with the definition 
of WITHIN GROUP's, so I think it might be feasible to do sort by expanding 
JSON_ARRAYAGG(... ORDER BY ...) to JSON_ARRAYAGG(...) WITHIN GROUP (ORDER 
BY...) during SQL parsing.

> Add order by clause support for JSON_ARRAYAGG
> ---------------------------------------------
>
>                 Key: CALCITE-2786
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2786
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Hongze Zhang
>            Assignee: Hongze Zhang
>            Priority: Major
>
> Both Oracle[1] and SQL:2016[2] supports or introduces an optional order by 
> clause in JSON_ARRAYAGG, the feature can be implemented since Calcite already 
> supports sorted aggregation.
> AFAICS, JSON_ARRAYAGG's order by clause has no difference with the definition 
> of WITHIN GROUP's, so I think it might be feasible to do sort by expanding 
> JSON_ARRAYAGG(... ORDER BY ...) to JSON_ARRAYAGG(...) WITHIN GROUP (ORDER 
> BY...) during SQL parsing.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to