forked from apache/calcite
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CALCITE-6266] SqlValidatorException with LATERAL TABLE and JOIN
The current precedence of ',' (the comma operator in 'FROM t1, t2') and 'JOIN' is wrong. JOIN is currently higher, and so in a query like SELECT * FROM dept, LATERAL (SELECT * FROM emp WHERE emp.deptno = dept.deptno) AS emp CROSS JOIN (VALUES ('A'), ('B')) AS v (v); the emp subqery is associated with v more tightly than dept, and therefore dept.deptno is not visible; the correct association is not (dept (emp v)) but ((dept emp) v). The LATERAL keyword, and the TABLE function mentioned in the bug, are not the root cause, but they do make the problem obvious because the wrong association causes a validation error. This commit fixes the precedence of the operators. Close apache#3871
- Loading branch information
1 parent
8659140
commit 9fa1e16
Showing
5 changed files
with
186 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters