-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-27209][SQL] Split parsing of SELECT and INSERT into two top-level rules in the grammar file. #24150
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
[SPARK-27209][SQL] Split parsing of SELECT and INSERT into two top-level rules in the grammar file. #24150
Changes from all commits
0e61c95
fa07a73
18afacd
f7aaebd
ea05263
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 |
|---|---|---|
|
|
@@ -81,6 +81,8 @@ singleTableSchema | |
|
|
||
| statement | ||
| : query #statementDefault | ||
| | insertStatement #insertStatementDefault | ||
| | multiSelectStatement #multiSelectStatementDefault | ||
| | USE db=identifier #use | ||
| | CREATE database (IF NOT EXISTS)? identifier | ||
| (COMMENT comment=STRING)? locationSpec? | ||
|
|
@@ -358,9 +360,14 @@ resource | |
| : identifier STRING | ||
| ; | ||
|
|
||
| insertStatement | ||
| : (ctes)? insertInto queryTerm queryOrganization #singleInsertQuery | ||
| | (ctes)? fromClause multiInsertQueryBody+ #multiInsertQuery | ||
|
||
| ; | ||
|
|
||
| queryNoWith | ||
| : insertInto? queryTerm queryOrganization #singleInsertQuery | ||
| | fromClause multiInsertQueryBody+ #multiInsertQuery | ||
| : queryTerm queryOrganization #noWithQuery | ||
|
||
| | fromClause selectStatement #queryWithFrom | ||
| ; | ||
|
|
||
| queryOrganization | ||
|
|
@@ -373,9 +380,15 @@ queryOrganization | |
| ; | ||
|
|
||
| multiInsertQueryBody | ||
| : insertInto? | ||
| querySpecification | ||
| queryOrganization | ||
| : insertInto selectStatement | ||
| ; | ||
|
|
||
| multiSelectStatement | ||
| : (ctes)? fromClause selectStatement+ #multiSelect | ||
| ; | ||
|
|
||
| selectStatement | ||
| : querySpecification queryOrganization | ||
| ; | ||
|
|
||
| queryTerm | ||
|
|
||
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.
Can you move
(ctes)?to the line 80 like| (ctes)? insertStatement?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.
@maropu then i may have to implement/override another visit method to apply the cte to an insert statement, okay ?
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.
the duplicate patten?
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.
@maropu Thats right. After this PR is in, i will have a follow-up to allow CTEs for DESCRIBE QUERY (currently it is a limitation) and that would remove this pattern all together (i hope :-) ).