You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2026/06/26 06:32:00 UTC

[jira] [Updated] (SPARK-57714) Add loser tree based k-way merger for UnsafeExternalSorter spill merge

     [ https://issues.apache.org/jira/browse/SPARK-57714?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated SPARK-57714:
-----------------------------------
    Labels: pull-request-available  (was: )

>  Add loser tree based k-way merger for UnsafeExternalSorter spill merge
> -----------------------------------------------------------------------
>
>                 Key: SPARK-57714
>                 URL: https://issues.apache.org/jira/browse/SPARK-57714
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>    Affects Versions: 4.0.0
>            Reporter: sunxiaojun
>            Priority: Major
>              Labels: pull-request-available
>
>  Add a loser tree based k-way merger as an opt-in alternative to the existing
>   priority-queue (binary heap) based UnsafeSorterSpillMerger used by
>   UnsafeExternalSorter to merge spill files.
>   
>   When UnsafeExternalSorter produces many spill files, the merge phase is
>   dominated by comparator cost. A loser tree performs one comparison and one
>   loser-slot read per level on each replay, versus two comparisons plus two
>   child reads for heap sift-down. For k-way merges, this roughly halves both
>   the comparison count and the array touches per popped record.
>   
>   The new merger is gated behind a new internal config
>   `spark.unsafe.sorter.spill.merger.useLoserTree`, defaulting to false so
>   behavior is unchanged unless explicitly enabled.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org