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

[jira] [Resolved] (SPARK-15677) Query with scalar sub-query in the SELECT list throws UnsupportedOperationException.

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

Wenchen Fan resolved SPARK-15677.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 2.0.0

Issue resolved by pull request 13418
[https://github.com/apache/spark/pull/13418]

> Query with scalar sub-query in the SELECT list throws UnsupportedOperationException.
> ------------------------------------------------------------------------------------
>
>                 Key: SPARK-15677
>                 URL: https://issues.apache.org/jira/browse/SPARK-15677
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.0.0
>            Reporter: Ioana Delaney
>             Fix For: 2.0.0
>
>
> Queries with scalar sub-query in the SELECT list run against a local, in-memory relation throw 
> UnsupportedOperationException exception.
> Problem repro:
> {noformat}
> scala> Seq((1, 1), (2, 2)).toDF("c1", "c2").createOrReplaceTempView("t1")
> scala> Seq((1, 1), (2, 2)).toDF("c1", "c2").createOrReplaceTempView("t2")
> scala> sql("select (select min(c1) from t2) from t1").show()
> {noformat}
> {noformat}
> java.lang.UnsupportedOperationException: Cannot evaluate expression: scalar-subquery#62 []
>   at org.apache.spark.sql.catalyst.expressions.Unevaluable$class.eval(Expression.scala:215)
>   at org.apache.spark.sql.catalyst.expressions.ScalarSubquery.eval(subquery.scala:62)
>   at org.apache.spark.sql.catalyst.expressions.Alias.eval(namedExpressions.scala:142)
>   at org.apache.spark.sql.catalyst.expressions.InterpretedProjection.apply(Projection.scala:45)
>   at org.apache.spark.sql.catalyst.expressions.InterpretedProjection.apply(Projection.scala:29)
>   at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
>   at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
>   at scala.collection.immutable.List.foreach(List.scala:381)
>   at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
>   at scala.collection.immutable.List.map(List.scala:285)
>   at org.apache.spark.sql.catalyst.optimizer.ConvertToLocalRelation$$anonfun$apply$37.applyOrElse(Optimizer.scala:1473)
> {noformat}



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