You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (JIRA)" <ji...@apache.org> on 2019/05/21 04:02:36 UTC
[jira] [Updated] (SPARK-20171) Analyzer should include the arity of
a function when reporting "AnalysisException: Undefined function"
[ https://issues.apache.org/jira/browse/SPARK-20171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hyukjin Kwon updated SPARK-20171:
---------------------------------
Labels: bulk-closed (was: )
> Analyzer should include the arity of a function when reporting "AnalysisException: Undefined function"
> ------------------------------------------------------------------------------------------------------
>
> Key: SPARK-20171
> URL: https://issues.apache.org/jira/browse/SPARK-20171
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 2.2.0
> Reporter: Jacek Laskowski
> Priority: Minor
> Labels: bulk-closed
>
> {{Analyzer}} reports {{AnalysisException}} when the arity of the function to be looked up is incorrect.
> The following {{AnalysisException}} was because the arity of {{cast}} was 2 (not 1), but it said {{cast}} was not available which is only partially correct. It'd be much more helpful to say something like {{"Undefined function: 'cast' with 2 params"}}.
> Hint: It'd be even nicer if the exception included candidates like: {{Did you mean "cast with 1 param"?}}
> {code}
> scala> sql("SELECT cast(id, INT) FROM range(1)").queryExecution.analyzed
> org.apache.spark.sql.AnalysisException: Undefined function: 'cast'. This function is neither a registered temporary function nor a permanent function registered in the database 'default'.; line 1 pos 7
> at org.apache.spark.sql.catalyst.analysis.Analyzer$LookupFunctions$$anonfun$apply$13$$anonfun$applyOrElse$44.apply(Analyzer.scala:1130)
> at org.apache.spark.sql.catalyst.analysis.Analyzer$LookupFunctions$$anonfun$apply$13$$anonfun$applyOrElse$44.apply(Analyzer.scala:1130)
> at org.apache.spark.sql.catalyst.analysis.package$.withPosition(package.scala:48)
> at org.apache.spark.sql.catalyst.analysis.Analyzer$LookupFunctions$$anonfun$apply$13.applyOrElse(Analyzer.scala:1129)
> at org.apache.spark.sql.catalyst.analysis.Analyzer$LookupFunctions$$anonfun$apply$13.applyOrElse(Analyzer.scala:1127)
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org