Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CALCITE-6266] Parser should be able to parse cross join with left lateral #3690

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

snuyanzin
Copy link
Contributor

No description provided.

Copy link

sonarcloud bot commented Feb 16, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

@jeyhunkarimov jeyhunkarimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @snuyanzin .
I have a few comments.

From the Calcite's parenthesized sub-clause in JOIN PR (CALCITE-35) also from the Parser.jj file in the main branch, I see:

        // Comma joins should only occur at top-level in the FROM clause.
        // Valid:
        //  * FROM a, b
        //  * FROM (a CROSS JOIN b), c
        // Not valid:
        //  * FROM a CROSS JOIN (b, c)

So, this query - select * from dept cross join ((VALUES ('A'), ('B')), (VALUES ('A'), ('B'))) should not pass (and it fails in the main branch). However, with this PR it passes. Am I missing sth?

Also, this query - select * from dept cross join ( lateral table(ramp(dept.deptno)) cross join (VALUES ('A'), ('B')) ) also fails with the exception Table 'DEPT' not found. We might need to investigate if this is an expected behaviour.

@@ -3606,9 +3606,7 @@ void checkPeriodPredicate(Checker checker) {
@Test void testMixedFrom() {
sql("select * from a join b using (x), c join d using (y)")
.ok("SELECT *\n"
+ "FROM `A`\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, that I also realised this is an issue...

Would be great to hear any ideas how we can cope with the original parser issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants