开发者社区> 问答> 正文

bypassMergeThreshold和bypassMergeSort是什么意思,怎么解释?

bypassMergeThreshold和bypassMergeSort是什么意思,怎么解释?

展开
收起
游客fbdr25iajcjto 2021-12-06 21:22:54 694 0
1 条回答
写回答
取消 提交回答
  • bypassMergeThreshold:

    传递到reduce端再做合并(merge)操作的阀值。如果partition的数量小于bypassMergeThreshold的值,则不需要在Executor执行聚合和排序操作,只需要将各个partition直接写到Executor的存储文件,最后在reduce端再做串联。通过配置spark.shuffle.sort.bypassMergeThreshold可以修改bypassMergeThreshold的大小,在分区数量小的时候提升计算引擎的性能。bypassMergeThreshold的默认值是200。

    bypassMergeSort:

    标记是否传递到reduce端再做合并和排序,即是否直接将各个partition直接写到Executor的存储文件。当没有定义aggregator、ordering函数,并且partition的数量小于等于bypassMergeThreshold时,bypassMergeSort为true。如果bypassMergeSort为true,map中间结果将直接输出到磁盘,此时不会占用太多内存,避免了内存撑爆问题。

    2021-12-06 21:23:38
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载