You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the process of replacing SqlParser with a parser generated by ANTLR, I came across a weird conditional in the implementation of SqlParser:
See this code block. It references the RHS of a JOIN, when the RHS is a PAREN. It makes a weird check about literals a SELECT.
Anyways, I actually believe that this check is wrong -- and therefore, these tests are also wrong.
Test No. 1 (SqlParserJoinTest > selectThreeJoinsSpecifiedOrderParensTest)
Input query:
SELECT x FROM A INNER JOIN (B INNER JOIN (C INNER JOIN D ON C = D) ON B = C) ON A = B
Expected result:
(select
(project
(project_list
(project_expr
(id x (case_insensitive) (unqualified))
null)))
(from
(join
(inner)
(join
(inner)
(join
(inner)
(scan
(id C (case_insensitive) (unqualified))
null
null
null)
(scan
(id D (case_insensitive) (unqualified))
null
null
null)
(eq
(id C (case_insensitive) (unqualified))
(id D (case_insensitive) (unqualified))))
(scan
(id B (case_insensitive) (unqualified))
null
null
null)
(eq
(id B (case_insensitive) (unqualified))
(id C (case_insensitive) (unqualified))))
(scan
(id A (case_insensitive) (unqualified))
null
null
null)
(eq
(id A (case_insensitive) (unqualified))
(id B (case_insensitive) (unqualified))))))
What I expected:
(select
(project
(project_list
(project_expr
(id x (case_insensitive) (unqualified))
null)))
(from
(join
(inner)
(scan
(id A (case_insensitive) (unqualified))
null
null
null)
(join
(inner)
(scan
(id B (case_insensitive) (unqualified))
null
null
null)
(join
(inner)
(scan
(id C (case_insensitive) (unqualified))
null
null
null)
(scan
(id D (case_insensitive) (unqualified))
null
null
null)
(eq
(id C (case_insensitive) (unqualified))
(id D (case_insensitive) (unqualified))))
(eq
(id B (case_insensitive) (unqualified))
(id C (case_insensitive) (unqualified))))
(eq
(id A (case_insensitive) (unqualified))
(id B (case_insensitive) (unqualified))))))
Other Tests
The other test that is wrong is: SqlParserJoinTest > selectTwoJoinsSpecifiedOrderParensTest.
Action Items
The test cases should be updated. This will be fixed in PartiQLParser by the upcoming parser merge.
The text was updated successfully, but these errors were encountered:
Description
In the process of replacing SqlParser with a parser generated by ANTLR, I came across a weird conditional in the implementation of SqlParser:
See this code block. It references the RHS of a JOIN, when the RHS is a PAREN. It makes a weird check about literals a SELECT.
Anyways, I actually believe that this check is wrong -- and therefore, these tests are also wrong.
Test No. 1 (SqlParserJoinTest > selectThreeJoinsSpecifiedOrderParensTest)
Input query:
Expected result:
What I expected:
Other Tests
The other test that is wrong is:
SqlParserJoinTest > selectTwoJoinsSpecifiedOrderParensTest
.Action Items
The test cases should be updated. This will be fixed in
PartiQLParser
by the upcoming parser merge.The text was updated successfully, but these errors were encountered: