Function parallelize_sorts

Source
pub fn parallelize_sorts(
    requirements: PlanWithCorrespondingCoalescePartitions,
) -> Result<Transformed<PlanWithCorrespondingCoalescePartitions>>
Expand description

This function turns plans of the form

     "SortExec: expr=\[a@0 ASC\]",
     "  CoalescePartitionsExec",
     "    RepartitionExec: partitioning=RoundRobinBatch(8), input_partitions=1",

to

     "SortPreservingMergeExec: \[a@0 ASC\]",
     "  SortExec: expr=\[a@0 ASC\]",
     "    RepartitionExec: partitioning=RoundRobinBatch(8), input_partitions=1",

by following connections from CoalescePartitionsExecs to SortExecs. By performing sorting in parallel, we can increase performance in some scenarios.