You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/10/22 22:53:30 UTC

[GitHub] [spark] jeff303 commented on issue #26144: [SPARK-27903][SQL] Improve the error messages of SQL parser

jeff303 commented on issue #26144: [SPARK-27903][SQL] Improve the error messages of SQL parser
URL: https://github.com/apache/spark/pull/26144#issuecomment-545189592
 
 
   > Can you show before and after error messages?
   
   Consider two simple queries.
   
   1. `select (r + 1))`
   2. `select ((r + 1)`
   
   
   Before, the error messages would be the following, respectively.
   
   ```
   org.apache.spark.sql.catalyst.parser.ParseException: 
   extraneous input ')' expecting <EOF>(line 1, pos 14)
   
   == SQL ==
   select (r + 1)) 
   --------------^^^
   org.apache.spark.sql.catalyst.parser.ParseException: 
   no viable alternative at input '((r + 1) '(line 1, pos 16)
   
   == SQL ==
   select ((r + 1) 
   ----------------^^^
   ```
   
   After:
   
   ```
   org.apache.spark.sql.catalyst.parser.ParseException: 
   Unbalanced parentheses (extra right)(line 1, pos 14)
   
   == SQL ==
   select (r + 1)) 
   --------------^^^
   
   org.apache.spark.sql.catalyst.parser.ParseException: 
   Unbalanced parentheses (extra left)(line 1, pos 7)
   
   == SQL ==
   select ((r + 1) 
   -------^^^
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org