You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "dtenedor (via GitHub)" <gi...@apache.org> on 2023/07/12 17:31:16 UTC
[GitHub] [spark] dtenedor opened a new pull request, #41965: [SPARK-44395][SQL] Update TVF arguments to require parentheses around identifier after TABLE keyword
dtenedor opened a new pull request, #41965:
URL: https://github.com/apache/spark/pull/41965
### What changes were proposed in this pull request?
This PR updates the parsing of table function arguments to require parentheses around identifier after the TABLE keyword.
* I kept the previous syntax without the parentheses as an optional case in the SQL grammar so that we can catch it in the `AstBuilder` and throw an informative error message telling the user to add parentheses and try the query again.
* I had to swap the order of parsing table function arguments, so the `table(identifier)` syntax does not accidentally parse as a scalar function call:
```
functionTableArgument
: functionTableReferenceArgument
| functionArgument
;
```
### Why are the changes needed?
This syntax is written down in the SQL standard. Per the standard, `TABLE identifier` should actually be passed as `TABLE(identifier)`.
### Does this PR introduce _any_ user-facing change?
Yes, SQL syntax changes slightly.
### How was this patch tested?
This PR adds and updates unit test coverage.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] ueshin closed pull request #41965: [SPARK-44395][SQL] Update TVF arguments to require parentheses around identifier after TABLE keyword
Posted by "ueshin (via GitHub)" <gi...@apache.org>.
ueshin closed pull request #41965: [SPARK-44395][SQL] Update TVF arguments to require parentheses around identifier after TABLE keyword
URL: https://github.com/apache/spark/pull/41965
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] allisonwang-db commented on a diff in pull request #41965: [SPARK-44395][SQL] Update TVF arguments to require parentheses around identifier after TABLE keyword
Posted by "allisonwang-db (via GitHub)" <gi...@apache.org>.
allisonwang-db commented on code in PR #41965:
URL: https://github.com/apache/spark/pull/41965#discussion_r1261819411
##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -1707,6 +1707,11 @@
},
"sqlState" : "42823"
},
+ "INVALID_TABLE_FUNCTION_IDENTIFIER_ARGUMENT_MISSING_PARENTHESES" : {
Review Comment:
Should this be under INVALID_SQL_SYNTAX?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dtenedor commented on a diff in pull request #41965: [SPARK-44395][SQL] Update TVF arguments to require parentheses around identifier after TABLE keyword
Posted by "dtenedor (via GitHub)" <gi...@apache.org>.
dtenedor commented on code in PR #41965:
URL: https://github.com/apache/spark/pull/41965#discussion_r1261833567
##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -1707,6 +1707,11 @@
},
"sqlState" : "42823"
},
+ "INVALID_TABLE_FUNCTION_IDENTIFIER_ARGUMENT_MISSING_PARENTHESES" : {
Review Comment:
Sounds good, this is done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] ueshin commented on pull request #41965: [SPARK-44395][SQL] Update TVF arguments to require parentheses around identifier after TABLE keyword
Posted by "ueshin (via GitHub)" <gi...@apache.org>.
ueshin commented on PR #41965:
URL: https://github.com/apache/spark/pull/41965#issuecomment-1634917680
Thanks! merging to master.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dtenedor commented on pull request #41965: [SPARK-44395][SQL] Update TVF arguments to require parentheses around identifier after TABLE keyword
Posted by "dtenedor (via GitHub)" <gi...@apache.org>.
dtenedor commented on PR #41965:
URL: https://github.com/apache/spark/pull/41965#issuecomment-1632939811
@ueshin FYI
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org