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

Julian Hyde resolved CALCITE-6759.
----------------------------------
    Fix Version/s: 1.39.0
       Resolution: Fixed

Fixed in 
[657f871|https://github.com/apache/calcite/commit/657f871bc28780eb91162e6231a35e00298f6a9a];
 thanks for the PR, [~suibianwanwan33]!

> SqlToRelConverter will remove the sort with offset
> --------------------------------------------------
>
>                 Key: CALCITE-6759
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6759
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: suibianwanwan
>            Assignee: suibianwanwan
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 1.39.0
>
>
> Tests in RelToSqlConverterTest:
> {code:java}
> @Test void testSortWithOffsetInSubQuery() {
>   final String sql = "select count(*) from (select * from emp order by empno 
> offset 10)";
>   sql(sql).ok();
> } {code}
> Plan:
> {code:java}
> LogicalAggregate(group=[{}], EXPR$0=[COUNT()])
>   LogicalProject($f0=[0])
>     LogicalTableScan(table=[[CATALOG, SALES, EMP]]) {code}
> Sort was removed because it didn't contain fetch. In PostgreSQL, SqlServer, 
> such a query is legal and will return the result after the offset.



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

Reply via email to