suibianwanwan created CALCITE-6759:
--------------------------------------

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


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