Copy partial data from one partition to another partition in apache spark

528 Views Asked by At

I have a use case where I start partitioning my data based on a key. All data belonging to a key stays on one partition. e.g.

Key1 -> Partition1 Key2 -> Partition2

Now After sometime I may need to merge the key1 and key2. Hence I just want to transfer all data from key2 to key1 i.e. from partition2 to partition1. Is it possible in apache spark? I don't want to repartition everything as it is costly for me.

0

There are 0 best solutions below