The repartition operator should read batches from its input partitions and then map that data to its output partitions using a specific partitioning scheme.
The simplest and most efficient partition schema would be a "round robin batch partitioner". For each input batch, it would pick the next output partition to write to. This is a convenient way to change the number of partitions up or down with minimal overhead.
Another example of a partitioning scheme would be a hash partitioner, which computes the hash of the partition keys on each incoming row and then applies a modulus to determine which output partition to write to.