xiedeyantu commented on code in PR #4733:
URL: https://github.com/apache/calcite/pull/4733#discussion_r2688586262
##########
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 test plan for the current main branch is as follows, which is similar to
the plan obtained from this pr, but this pr fixes the issue with rand().
The same SQL:
```
select distinct deptno, deptno, empno, 1, 'a' from emp order by rand(), 1
```
Current main branch Plan:
```
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=[$4])
LogicalAggregate(group=[{0, 1, 2, 3, 4}])
LogicalProject(DEPTNO=[$7], EMPNO=[$0], EXPR$3=[1], EXPR$4=['a'],
EXPR$5=[RAND()])
LogicalTableScan(table=[[CATALOG, SALES, EMP]])
```
Should I start by squashing commits to prepare for the merge?
--
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]