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/04/30 08:51:12 UTC

[jira] [Commented] (SPARK-15029) Bad error message for two generators in the project clause

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

Reynold Xin commented on SPARK-15029:
-------------------------------------

cc  [~cloud_fan]

For this one, maybe we should throw a better exception in ResolveGenerate. Something like

{code}
          failAnalysis(
            s"Only one generator allowed per select clause but found ${generators.size}: " +
              generators.map(_.sql).mkString(", "))
{code}


> Bad error message for two generators in the project clause
> ----------------------------------------------------------
>
>                 Key: SPARK-15029
>                 URL: https://issues.apache.org/jira/browse/SPARK-15029
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Reynold Xin
>
> {code}
> scala> spark.range(1000).map(i => (Array[Long](i), Array[Long](i))).selectExpr("explode(_1)", "explode(_2)").explain(true)
> org.apache.spark.sql.AnalysisException: Only one generator allowed per select but Generate and and Explode found.;
>   at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$class.failAnalysis(CheckAnalysis.scala:39)
>   at org.apache.spark.sql.catalyst.analysis.Analyzer.failAnalysis(Analyzer.scala:54)
>   at org.apache.spark.sql.catalyst.analysis.Analyzer$ResolveGenerate$$anonfun$apply$21$$anonfun$53.apply(Analyzer.scala:1275)
>   at org.apache.spark.sql.catalyst.analysis.Analyzer$ResolveGenerate$$anonfun$apply$21$$anonfun$53.apply(Analyzer.scala:1272)
>   at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
>   at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
>   at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
>   at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
>   at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:241)
>   at scala.collection.AbstractTraversable.flatMap(Traversable.scala:104)
> {code}
> It's confusing to call one "Generator" and the other "Explode". There is also two "and"s.



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