-
Notifications
You must be signed in to change notification settings - Fork 612
join syntax #459
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
Comments
Here is the output for the 0.16.0 version: sql: "SELECT a.* FROM mytable a join mytable b on a.id=b.id" sql: "select a.* from mytable a, mytable b where a.id=b.id" |
Since no-one had the chance to reply yet, and I was around when the current implementation landed in #109, I can share my perspective. The parser's job is to produce the parse tree, i.e. determine the syntactic structure of the input text according to the grammar of the language. That's what it currently does -- you can see that in the SQL grammar, which we roughly follow, FROM and WHERE are two separate clauses. You seem to want to do some semantic analysis, which is normally done in a separate step. Note that there isn't a single universally correct answer to "how these are [supposed to be] joined together", if you're not content with the syntax-based answer. For instance the following slightly more complicated example:
..can be described
|
Thanks.. That makes sense. |
Uh oh!
There was an error while loading. Please reload this page.
If we do a join based on the syntax:
select a.id, b.id from mytable a join mytable1 b on a.id=b.id;
We get a single TablewithJoins strcut that shows how the join occurs (see below), but if we do:
select * from mytable a, mytable b where a.id=b.id;
We get two TableWithJoins but there is nothing that says how these two are joined together.. Should these two select statements produce the same TableWithJoin structure?
Here's the output from my tests:
The text was updated successfully, but these errors were encountered: