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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to