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:04:18 UTC

[jira] [Updated] (SPARK-19928) Incorrect error message when grouping function used with wrong types

     [ https://issues.apache.org/jira/browse/SPARK-19928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hyukjin Kwon updated SPARK-19928:
---------------------------------
    Labels: bulk-closed  (was: )

> Incorrect error message when grouping function used with wrong types
> --------------------------------------------------------------------
>
>                 Key: SPARK-19928
>                 URL: https://issues.apache.org/jira/browse/SPARK-19928
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.2.0
>            Reporter: Jacek Laskowski
>            Priority: Minor
>              Labels: bulk-closed
>
> Despite `grouping` being used with no {{GroupingSets/Cube/Rollup}} the message is plain wrong as the number of arguments for the function is indeed correct (but failed type checking).
> {code}
> scala> sql("select grouping(*) from t1").show
> org.apache.spark.sql.AnalysisException: Invalid number of arguments for function grouping; line 1 pos 7
>   at org.apache.spark.sql.catalyst.analysis.FunctionRegistry$$anonfun$5.apply(FunctionRegistry.scala:476)
>   at org.apache.spark.sql.catalyst.analysis.FunctionRegistry$$anonfun$5.apply(FunctionRegistry.scala:459)
>   at org.apache.spark.sql.catalyst.analysis.SimpleFunctionRegistry.lookupFunction(FunctionRegistry.scala:89)
>   at org.apache.spark.sql.catalyst.catalog.SessionCatalog.lookupFunction(SessionCatalog.scala:1100)
>   at org.apache.spark.sql.hive.HiveSessionCatalog.org$apache$spark$sql$hive$HiveSessionCatalog$$super$lookupFunction(HiveSessionCatalog.scala:194)
>   at org.apache.spark.sql.hive.HiveSessionCatalog$$anonfun$3.apply(HiveSessionCatalog.scala:194)
>   at org.apache.spark.sql.hive.HiveSessionCatalog$$anonfun$3.apply(HiveSessionCatalog.scala:194)
>   at scala.util.Try$.apply(Try.scala:192)
>   at org.apache.spark.sql.hive.HiveSessionCatalog.lookupFunction0(HiveSessionCatalog.scala:194)
>   at org.apache.spark.sql.hive.HiveSessionCatalog.lookupFunction(HiveSessionCatalog.scala:180)
>   at org.apache.spark.sql.catalyst.analysis.Analyzer$ResolveFunctions$$anonfun$apply$14$$anonfun$applyOrElse$6$$anonfun$applyOrElse$45.apply(Analyzer.scala:1085)
> ...
> {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