GuoPhilipse commented on pull request #29126:
URL: https://github.com/apache/spark/pull/29126#issuecomment-659373259


   > > We have the following defined in 
spark/sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4.
 but it seems pivotClause and lateralView need to replace the order too?
   > 
   > Why did you think so? Seems like the definition make the error message 
explicit:
   > [#21324 
(comment)](https://github.com/apache/spark/pull/21324#discussion_r188078585)
   
   @maropu  Now my confusing point is the following sytax is not defined in 
SqlBase.g4. but it seems to be allowed to used in Spark, and no errors throw 
out. it might be  understandable if this behavior throws error like `LATERAL 
cannot be used together with PIVOT in FROM clause` or basic sytax error. 
   
   ```
   SELECT * FROM person
   PIVOT (
   count(distinct age) as a
   for name in ('Mary','John')
   )
   lateral view outer explode(array(30,60)) tabelName as c_age
   lateral view explode(array(40,80)) as d_age
   ```


----------------------------------------------------------------
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.

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