xiedeyantu commented on code in PR #4733:
URL: https://github.com/apache/calcite/pull/4733#discussion_r2688369013


##########
core/src/test/resources/org/apache/calcite/test/SqlToRelConverterTest.xml:
##########
@@ -1892,15 +1892,15 @@ LogicalTableModify(table=[[CATALOG, SALES, EMP]], 
operation=[DELETE], flattened=
   </TestCase>
   <TestCase name="testDistinctOrderByRand">
     <Resource name="sql">
-      <![CDATA[select distinct deptno, empno, 1, 'a' from emp order by rand(), 
1]]>
+      <![CDATA[select distinct deptno, deptno, empno, 1, 'a' from emp order by 
rand(), 1]]>
     </Resource>
     <Resource name="plan">
       <![CDATA[
-LogicalProject(DEPTNO=[$0], EMPNO=[$1], EXPR$2=[$2], EXPR$3=[$3])
-  LogicalSort(sort0=[$4], sort1=[$0], dir0=[ASC], dir1=[ASC])
-    LogicalProject(DEPTNO=[$0], EMPNO=[$1], EXPR$2=[$2], EXPR$3=[$3], 
EXPR$4=[RAND()])
+LogicalProject(DEPTNO=[$0], DEPTNO1=[$1], EMPNO=[$2], EXPR$2=[$3], EXPR$3=[$4])
+  LogicalSort(sort0=[$5], sort1=[$0], dir0=[ASC], dir1=[ASC])
+    LogicalProject(DEPTNO=[$0], DEPTNO0=[$0], EMPNO=[$1], EXPR$3=[$2], 
EXPR$4=[$3], EXPR$5=[RAND()])

Review Comment:
   My understanding is that the intermediate PROJECT1-AGG-PROJECT2 represents 
the logic that the current modification can achieve. Therefore, PROJECT1 needs 
to retain duplicate columns, but AGG should not have duplicate columns. If 
PROJECT1 does not retain them, this information will be lost.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to