You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Reynold Xin (JIRA)" <ji...@apache.org> on 2016/02/13 07:50:18 UTC

[jira] [Commented] (SPARK-12772) Better error message for parsing failure?

    [ https://issues.apache.org/jira/browse/SPARK-12772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15145842#comment-15145842 ] 

Reynold Xin commented on SPARK-12772:
-------------------------------------

[~hvanhovell] would you have time to look into this? I find the parser error messages pretty bad when I hit some errors today. Another example is

{code}
scala> sql("select 1'")
org.apache.spark.sql.AnalysisException: NoViableAltException(5@[()* loopback of 214:20: ( ( LSQUARE ^ expression RSQUARE !) | ( DOT ^ identifier ) )*])
line 1:8 cannot recognize input near ''' '<EOF>' '<EOF>' in expression specification
; line 1 pos 8
{code}



> Better error message for parsing failure?
> -----------------------------------------
>
>                 Key: SPARK-12772
>                 URL: https://issues.apache.org/jira/browse/SPARK-12772
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.0.0
>            Reporter: Reynold Xin
>
> {code}
> scala> sql("select case if(true, 'one', 'two')").explain(true)
> org.apache.spark.sql.AnalysisException: org.antlr.runtime.EarlyExitException
> line 1:34 required (...)+ loop did not match anything at input '<EOF>' in case expression
> ; line 1 pos 34
> 	at org.apache.spark.sql.catalyst.parser.ParseErrorReporter.throwError(ParseDriver.scala:140)
> 	at org.apache.spark.sql.catalyst.parser.ParseErrorReporter.throwError(ParseDriver.scala:129)
> 	at org.apache.spark.sql.catalyst.parser.ParseDriver$.parse(ParseDriver.scala:77)
> 	at org.apache.spark.sql.catalyst.CatalystQl.createPlan(CatalystQl.scala:53)
> 	at org.apache.spark.sql.hive.ExtendedHiveQlParser$$anonfun$hiveQl$1.apply(ExtendedHiveQlParser.scala:41)
> 	at org.apache.spark.sql.hive.ExtendedHiveQlParser$$anonfun$hiveQl$1.apply(ExtendedHiveQlParser.scala:40)
> {code}
> Is there a way to say something better other than "required (...)+ loop did not match anything at input"?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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