mihaibudiu commented on code in PR #4474:
URL: https://github.com/apache/calcite/pull/4474#discussion_r2223956372


##########
core/src/test/resources/sql/lateral.iq:
##########
@@ -246,4 +246,98 @@ where job = 'MANAGER';
 
 !ok
 
+# [CALCITE-4693] Query with Lateral Join should converted to Left Join When 
sub-query is aggregate query
+
+select * from "scott".dept, lateral (select count(cast(deptno as integer)) 
from "scott".emp where emp.deptno = dept.deptno);
++--------+------------+----------+--------+
+| DEPTNO | DNAME      | LOC      | EXPR$0 |
++--------+------------+----------+--------+
+|     10 | ACCOUNTING | NEW YORK |      3 |
+|     20 | RESEARCH   | DALLAS   |      5 |
+|     30 | SALES      | CHICAGO  |      6 |
+|     40 | OPERATIONS | BOSTON   |      0 |
++--------+------------+----------+--------+
+(4 rows)
+
+!ok
+EnumerableCalc(expr#0..4=[{inputs}], expr#5=[IS NULL($t4)], expr#6=[0:BIGINT], 
expr#7=[CASE($t5, $t6, $t4)], proj#0..2=[{exprs}], EXPR$0=[$t7])

Review Comment:
   We now have !explain-validated-on, which provides much higher level plans



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