You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2015/03/24 09:01:52 UTC

[jira] [Commented] (SPARK-6376) Subqueries are thrown away too early in dataframes

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

Apache Spark commented on SPARK-6376:
-------------------------------------

User 'marmbrus' has created a pull request for this issue:
https://github.com/apache/spark/pull/5160

> Subqueries are thrown away too early in dataframes
> --------------------------------------------------
>
>                 Key: SPARK-6376
>                 URL: https://issues.apache.org/jira/browse/SPARK-6376
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Michael Armbrust
>            Assignee: Michael Armbrust
>            Priority: Critical
>
> Because we throw away aliases as we construct the query plan, you can't reference them later.  For example, this query fails:
> {code}
>   test("self join with aliases") {
>     val df = Seq(1,2,3).map(i => (i, i.toString)).toDF("int", "str")
>     checkAnswer(
>       df.as('x).join(df.as('y), $"x.str" === $"y.str").groupBy("x.str").count(),
>       Row("1", 1) :: Row("2", 1) :: Row("3", 1) :: Nil)
>   }
> {code}
> {code}
> [info]   org.apache.spark.sql.AnalysisException: Cannot resolve column name "x.str" among (int, str, int, str);
> [info]   at org.apache.spark.sql.DataFrame$$anonfun$resolve$1.apply(DataFrame.scala:162)
> [info]   at org.apache.spark.sql.DataFrame$$anonfun$resolve$1.apply(DataFrame.scala:162)
> {code}



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