Mhmmm. Maybe I am not reading this correctly. What is the logic here? How come you are assigning key = 1 to every tuple? That makes the reduceByKey operate on only a single partition.