-
Notifications
You must be signed in to change notification settings - Fork 3
Syntax scope requirements for (NOT)EXISTS #355
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8988,6 +8988,34 @@ <h4>Variable Scope</h4> | |
| </tr> | ||
| </tbody> | ||
| </table> | ||
|
|
||
| <p> | ||
| Syntax forms `EXISTS` or `NOT EXISTS` can appear inside | ||
| <a href="#rExpression">expressions</a>. | ||
| Expressions appear in | ||
| <a href="#rFilter">`FILTER`</a>, | ||
| <a href="#rHavingClause">`HAVING`</a>, | ||
| and places where `AS` is permitted; | ||
| (<a href="#rBind">`BIND`</a>, | ||
| <a href="#rSelectClause">a select clause</a>, | ||
| and <a href="#rGroupClause">`GROUP BY`</a>). | ||
| </p> | ||
|
|
||
|
|
||
| <!-- @@ remove | ||
| <p> | ||
| Syntax forms `EXISTS` or `NOT EXISTS` appear inside | ||
| a `FILTER` and filters appear inside group graph patterns. | ||
| Let `F` be a syntax form `FILTER` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it's not intentional. (See Greg's comment). It is trying to say that scope is modified only for the leaves of the AST that can set variables - BGPs and paths. From there, the current row variables is in-scope by the usual rules and include the current row. I'll revise it. |
||
| appearing inside group graph pattern `GP`, | ||
| then for all | ||
| syntax forms `EXISTS {P}` or `NOT EXISTS {P}`, | ||
| any variable that is in-scope for `GP` is | ||
| also in-scope for all group graph patterns, | ||
| basic graph patterns, and paths inside `P`. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "...also in-scope for all group graph patterns, basic graph patterns, and paths inside
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nesting - any group graph pattern. The requirement is to include the variables of the current row at the bottom then they get incorporated all the way up to |
||
| </p> | ||
| --> | ||
|
|
||
| <p>The variable `v` must not be in-scope at the point of the | ||
| `(expr AS v)` form. The scoping for `(expr AS v)` | ||
| applies immediately in `SELECT` expressions. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems overly restrictive in suggesting that (not) exists only appears inside filters (and not other places where expressions can be used).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change enough?
"inside a FILTER and filters appear inside group graph patterns."
==>
"inside expressions <link to [127] Expression>."
Or something that enumerates the places that expressions occur, filter, AS, ORDER BY, (
GROUP BYandHAVINGare allowAS).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expressionwould be good, I think.