[
https://issues.apache.org/jira/browse/CALCITE-6759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17909435#comment-17909435
]
Julian Hyde edited comment on CALCITE-6759 at 1/2/25 11:41 PM:
---------------------------------------------------------------
I think you should fix {{RelOptUtil.isPureOrder}}.
Also, it would be straightforward to add a Quidem test that gives the right
result only after the fix.
was (Author: julianhyde):
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)