xiedeyantu commented on code in PR #4704:
URL: https://github.com/apache/calcite/pull/4704#discussion_r2649394172
##########
core/src/test/resources/sql/hep.iq:
##########
@@ -149,6 +150,37 @@ EnumerableCalc(expr#0..3=[{inputs}], MGR=[$t1], COMM=[$t2])
EnumerableCalc(expr#0..7=[{inputs}], expr#8=[CAST($t6):DECIMAL(12, 2)],
expr#9=[5.00:DECIMAL(12, 2)], expr#10=[>($t8, $t9)], expr#11=[IS NOT
NULL($t3)], expr#12=[AND($t10, $t11)], MGR=[$t3], $condition=[$t12])
EnumerableTableScan(table=[[scott, EMP]])
!plan
+!}
+
+!if (enable_new_decorrelator) {
+SELECT e1.mgr, e1.comm
+FROM emp e1
+WHERE e1.mgr > 12
+ AND EXISTS (
+ SELECT 1
+ FROM emp e2
+ WHERE e2.mgr = e1.mgr
+ AND e2.comm > 5);
++------+---------+
+| MGR | COMM |
++------+---------+
+| 7698 | 0.00 |
+| 7698 | 1400.00 |
+| 7698 | 300.00 |
+| 7698 | 500.00 |
+| 7698 | |
++------+---------+
+(5 rows)
+
+!ok
+EnumerableCalc(expr#0..2=[{inputs}], MGR=[$t1], COMM=[$t2])
+ EnumerableHashJoin(condition=[IS NOT DISTINCT FROM($1, $4)], joinType=[semi])
+ EnumerableCalc(expr#0..7=[{inputs}], expr#8=[CAST($t3):INTEGER],
expr#9=[12], expr#10=[>($t8, $t9)], EMPNO=[$t0], MGR=[$t3], COMM=[$t6],
$condition=[$t10])
+ EnumerableTableScan(table=[[scott, EMP]])
+ EnumerableCalc(expr#0..7=[{inputs}], expr#8=[CAST($t6):DECIMAL(12, 2)],
expr#9=[5.00:DECIMAL(12, 2)], expr#10=[>($t8, $t9)], expr#11=[IS NOT
NULL($t3)], expr#12=[AND($t10, $t11)], EMPNO=[$t0], MGR=[$t3], COMM=[$t6],
$condition=[$t12])
+ EnumerableTableScan(table=[[scott, EMP]])
+!plan
Review Comment:
I think we can't just ignore them; we still need to use `!if` statements to
process them one by one. This is because the SQL plans in the `.iq` file aren't
necessarily covered by other tests (such as `RelOptRulesTest`), so they still
have value, even if we can ignore the `!plan` comparison. My approach is to
handle each case rigorously, although this might be quite extensive.
--
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]