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

Mihai Budiu resolved CALCITE-6748.
----------------------------------
    Fix Version/s: 1.39.0
       Resolution: Fixed

Fixed in 
https://github.com/apache/calcite/commit/7d4135eb17e2a70ac608ab1dd3e5a7f4d03706da
Thank you for the contribution [~suibianwanwan33]
Thank you reviewers, @nobigo [~zhehu]

> RelToSqlConverter returns the wrong result when Aggregate is on Sort
> --------------------------------------------------------------------
>
>                 Key: CALCITE-6748
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6748
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: suibianwanwan
>            Assignee: suibianwanwan
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 1.39.0
>
>
> Example:
> {code:java}
> @Test void testAggregateSort() {
>   final String query = "select max(\"product_class_id\") "
>       + "from (select * from \"product\" order by \"brand_name\" limit 10) t";
>   final String expected = "SELECT MAX(\"product_class_id\")\n"
>       + "FROM \"foodmart\".\"product\"\n"
>       + "ORDER BY \"brand_name\"\n"
>       + "FETCH NEXT 10 ROWS ONLY";
>   sql(query).ok(expected);
> } {code}
> In the above example, the order of aggregation and sorting is reversed, and 
> such a query will return an error in some query sources



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to