Liu Kaijie created SPARK-10852:
----------------------------------
Summary: DataFrame aggregated column cannot access 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: [email protected]
For additional commands, e-mail: [email protected]