You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Jacek Laskowski (JIRA)" <ji...@apache.org> on 2017/03/12 21:06:04 UTC

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

Jacek Laskowski created SPARK-19928:
---------------------------------------

             Summary: 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


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
(v6.3.15#6346)

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