Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
Return an RDD created by coalescing all elements within each partition into a list.
Carmen Silva-Corvalan
Programming language:
Python
2021-07-15 12:45:32
0
Q:
Return an RDD created by coalescing all elements within each partition into a list.
Tracy Hieatt
Code:
Python
2021-07-03 22:37:55
rdd
= sc.parallelize([
1
,
2
,
3
,
4
],
2
)
sorted
(rdd.glom().collect())
# [[1, 2], [3, 4]]
0
Tags
list
element
int
turn
within
create
return
into
Related
Return the Cartesian product of this RDD and another one, that is, the RDD of all pairs of elements (a, b) where a is in self and b is in other.
Return a new RDD containing the distinct elements in this RDD.
Reduces the elements of this RDD using the specified commutative and associative binary operator
Group the values for each key in the RDD into a single sequence.
Aggregate the elements of each partition, and then the results for all the partitions
Create a new RDD of int containing elements from start to end (exclusive), increased by step every element.
Return the intersection of this RDD and another one
Return a new RDD by applying a function to each element of this RDD.
Return an RDD containing all pairs of elements with matching keys in self and other.
Return an RDD with the keys of each tuple.
Applies a function to all elements of this RDD.
Return a new RDD containing only the elements that satisfy a predicate.
New to Communities?
Join the community