An issue with nested Joins #1636
Replies: 1 comment 5 replies
-
Can you post the exact query you're trying to parse and include the stack trace & the error you're getting? Make sure to include the |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all,
I was trying to use sqlglot to get a list of Columns and Tables in the SQL. When a nested Join is seen, the tool complains about "Invalid Expression / Unexpected token". I was able to go past it, and see correct results by commenting out the "raiser error" in parser. However, I am certain this is not the correct way. Anyone seen this behavior? Here is some more details about the specific issue:
Table A
INNER JOIN Table B
INNER JOIN Table C
ON B.Col1 = C.Col1
INNER JOIN TABLE D
ON C.Col1 = D.Col1
INNER JOIN TABLE E
ON A.Col1 = E.Col1
So basically, INNER Join references the table but joins on it after other Joins have happened. Removing the last line for join also resolves the issue, but again that is just to point out the issue and is not a solution.
Beta Was this translation helpful? Give feedback.
All reactions