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/09/29 06:59:05 UTC
[jira] [Assigned] (SPARK-10852) DataFrame aggregated column cannot
be accessed properly
[ https://issues.apache.org/jira/browse/SPARK-10852?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Apache Spark reassigned SPARK-10852:
------------------------------------
Assignee: (was: Apache Spark)
> DataFrame aggregated column cannot be accessed properly
> -------------------------------------------------------
>
> Key: SPARK-10852
> URL: https://issues.apache.org/jira/browse/SPARK-10852
> Project: Spark
> Issue Type: Bug
> Components: PySpark
> Affects Versions: 1.5.0
> Environment: witness on both OSX and Linux
> Reporter: Liu Kaijie
>
> This code snippet works fine in spark-1.4.1
> {code}
> rdd = sc.parallelize([1,2,1,3])
> df = sqlContext.createDataFrame(rdd.map(lambda x: Row(id=x)))
> df = df.groupby("id").count()
> df.map(lambda x: x.count).collect()
> {code}
> While it throws exception in spark-1.5.0 as following:
> +TypeError: expected string or Unicode object, NoneType found+
> and I can work around by replacing the last code line with:
> {code}
> df.map(lambda x: x.asDict()["count"]).collect()
> {code}
> But I don't think this is expected, right?
--
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