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


##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -1418,6 +1418,29 @@ private void handleOffsetFetch(@Nullable SqlNode offset, 
@Nullable SqlNode fetch
       if (node instanceof SqlMerge) {
         validatingSqlMerge = true;
       }
+      if (node instanceof SqlJoin) {
+        // select * from "scott".dept,
+        //     lateral (select count(cast(deptno as integer)) from "scott".emp
+        //         where emp.deptno = dept.deptno);
+        // ==》
+        // select * from "scott".dept left join
+        //     lateral (select count(cast(deptno as integer)) from "scott".emp
+        //        where emp.deptno = dept.deptno) on true;
+        SqlJoin sqlJoin = (SqlJoin) node;
+        if (sqlJoin.getJoinType() == JoinType.COMMA && sqlJoin.getRight() 
instanceof SqlCall) {

Review Comment:
   I will recheck this. This repair method does have some issues. I will add 
more test cases to verify it.



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