Details
-
Sub-task
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.1.0
-
None
-
None
Description
scala> spark.sql("select * from a left joinn b on a.id = b.id").show org.apache.spark.sql.catalyst.parser.ParseException: mismatched input 'from' expecting {<EOF>, 'WHERE', 'GROUP', 'ORDER', 'HAVING', 'LIMIT', 'LATERAL', 'WINDOW', 'UNION', 'EXCEPT', 'MINUS', 'INTERSECT', 'SORT', 'CLUSTER', 'DISTRIBUTE'}(line 1, pos 9) == SQL == select * from a left joinn b on a.id = b.id ---------^^^
The issue is that ^^^ points at from, not at joinn. The text of the error makes no sense either. If *, a, and b are complex in themselves, a misleading error like this can hinder debugging substantially.
I tried to see if maybe I could fix this. Am I correct to deduce that the error message originates in ANTLR4, which parses the query based on the syntax defined in SqlBase.g4? If so, I guess I would have to figure out how that syntax definition works, and why it misattributes the error.
Attachments
Issue Links
- links to