charmander123
charmander123

Reputation: 367

pyspark: parallelize and collect order preserving

For spark in python, do the sc.parallelize() and collect() operations preserve order? For example if I have a list of elements x, will sc.parallelize(x).collect() return a list of elements in the exact same order as x?

Upvotes: 7

Views: 1388

Answers (1)

user6022341
user6022341

Reputation:

Both parallelize and collect preserve order. Most of the methods in Spark don't.

Upvotes: 1

Related Questions