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 2016/08/15 15:37:20 UTC

[jira] [Assigned] (SPARK-16995) TreeNodeException when flat mapping RelationalGroupedDataset created from DataFrame containing a column created with lit/expr

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

Apache Spark reassigned SPARK-16995:
------------------------------------

    Assignee:     (was: Apache Spark)

> TreeNodeException when flat mapping RelationalGroupedDataset created from DataFrame containing a column created with lit/expr
> -----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-16995
>                 URL: https://issues.apache.org/jira/browse/SPARK-16995
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.0.0
>            Reporter: Cédric Perriard
>
> A TreeNodeException is thrown when executing the following minimal example in Spark 2.0. Crucial is that the column q is generated with lit/expr. 
> {code}
> import spark.implicits._
> case class test (x: Int, q: Int)
> val d = Seq(1).toDF("x")
> d.withColumn("q", lit(0)).as[test].groupByKey(_.x).flatMapGroups{case (x, iter) => List()}.show
> d.withColumn("q", expr("0")).as[test].groupByKey(_.x).flatMapGroups{case (x, iter) => List()}.show
> // this works fine
> d.withColumn("q", lit(0)).as[test].groupByKey(_.x).count()
> {code}
> The exception is: org.apache.spark.sql.catalyst.errors.package$TreeNodeException: Binding attribute, tree: x#5
> A possible workaround is to write the dataframe to disk before grouping and mapping.



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