I would like to perform an action on a single column. Unfortunately, after I converted this column, it is no longer part of the data frame from which it was derived, but became a Column object. As such, it cannot be assembled.
Here is an example:
df = sqlContext.createDataFrame([Row(array=[1,2,3])]) df['array'].collect()
This results in the following error:
Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'Column' object is not callable
How can I use the collect() function for a single column?
dataframe apache-spark pyspark apache-spark-sql spark-dataframe
Michal
source share