hsyuan commented on a change in pull request #1985:
URL: https://github.com/apache/calcite/pull/1985#discussion_r431483152



##########
File path: core/src/test/resources/org/apache/calcite/test/TopDownOptTest.xml
##########
@@ -318,6 +318,31 @@ EnumerableProject(ENAME=[$0], JOB=[$1], EXPR$2=[$2], 
ENAME0=[$3], JOB0=[$4], SAL
     EnumerableSort(sort0=[$4], sort1=[$0], dir0=[ASC], dir1=[ASC])
       EnumerableProject(ENAME=[$0], JOB=[$1], SAL=[$2], COMM=[$3], 
JOB0=[CAST($1):BIGINT NOT NULL])
         EnumerableTableScan(table=[[CATALOG, SALES, BONUS]])
+]]>
+        </Resource>
+    </TestCase>
+    <TestCase name="testSortProjectDerive5">
+        <Resource name="sql">
+            <![CDATA[
+select empno*-1, ename, job from
+(select * from sales.emp order by empno, ename, job limit 10) order by ename, 
job
+]]>
+        </Resource>
+        <Resource name="planBefore">
+            <![CDATA[
+LogicalSort(sort0=[$1], sort1=[$2], dir0=[ASC], dir1=[ASC])
+  LogicalProject(EXPR$0=[*($0, -1)], ENAME=[$1], JOB=[$2])
+    LogicalSort(sort0=[$0], sort1=[$1], sort2=[$2], dir0=[ASC], dir1=[ASC], 
dir2=[ASC], fetch=[10])
+      LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], 
HIREDATE=[$4], SAL=[$5], COMM=[$6], DEPTNO=[$7], SLACKER=[$8])
+        LogicalTableScan(table=[[CATALOG, SALES, EMP]])
+]]>
+        </Resource>
+        <Resource name="planAfter">
+            <![CDATA[
+EnumerableProject(EXPR$0=[*($0, -1)], ENAME=[$1], JOB=[$2])
+  EnumerableLimit(fetch=[10])
+    EnumerableSort(sort0=[$0], sort1=[$1], sort2=[$2], dir0=[ASC], dir1=[ASC], 
dir2=[ASC])
+      EnumerableTableScan(table=[[CATALOG, SALES, EMP]])

Review comment:
       The plan is wrong




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to