Return An Rdd Created By Coalescing All Elements Within Each

[Solved] Return An Rdd Created By Coalescing All Elements Within Each | Abap - Code Explorer | yomemimo.com
Question : Return an RDD created by coalescing all elements within each partition into a list.

Answered by : abdoulaye

rdd = sc.parallelize([1, 2, 3, 4], 2)
sorted(rdd.glom().collect())
# [[1, 2], [3, 4]]

Source : http://spark.apache.org/docs/2.1.0/api/python/pyspark.html#pyspark.RDD.glom | Last Update : Wed, 18 Mar 20

Answers related to return an rdd created by coalescing all elements within each partition into a list

Code Explorer Popular Question For Abap