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

Julian Hyde commented on CALCITE-6759:
--------------------------------------

I think you should fix {{RelOptUtil.isPureOrder}}.

> 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
>
> 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