[
https://issues.apache.org/jira/browse/SPARK-19928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15906814#comment-15906814
]
Jacek Laskowski commented on SPARK-19928:
-----------------------------------------
OKey. I agree that it's not completely wrong, but it's just not as helpful as
it could be. And certainly very surprising. After all, the star is just a
single argument for a Spark developer and it could work for some cases where
the relation happened to have just one column. I think it's tricky to explain
it in all cases and that's why I reported it as an improvement.
Handling the case with `*` could make it a little bit less tricky and more user
friendly, couldn't it?
p.s. Thanks Herman for a very good lesson on how analyzer/star expansion works
under the covers!
> 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: [email protected]
For additional commands, e-mail: [email protected]