Comet Native Executors: sample a range exchange without re-running the stages below it

已关闭
#7,367 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
rust, scala

调研方向

Start with range_exchange in native/native-executors/src/assembly.rs and collect in src/frontend.rs to trace how sampling runs the stages below an exchange. Compare the proposed approaches, including materialized shuffle reuse and runtime sampling; done means range exchanges can be sampled without repeatedly rerunning lower stages. The issue does not select an approach, so clarify the design before implementation.

由索引模型根据 Issue 内容生成。

描述

enhancement requires-triage
What is the problem the feature request solves?

To range-partition an exchange, the Comet scheduler (#7289) runs a sampling job of its own: a SampleExec over the stage that feeds the exchange. That is a separate Ballista job, so it runs that stage and every stage below it, then the query runs them all again. Every further range exchange above them adds another run. Spark's RangePartitioner also re-runs the child, but it reuses the shuffle outputs below it.

The sampling jobs also run one after another while the query is being planned, even for range exchanges whose inputs don't depend on each other.

Describe the potential solution

Options, roughly from least to most work:

  • Sample range exchanges whose inputs are independent concurrently.
  • Sample from the materialized shuffle output below the exchange, so only the producing stage runs twice.
  • Find the split points at run time, as Ballista's adaptive planner does for window functions: RuntimeStatsExec keeps a quantile sketch and UnorderedRangeRepartitionExec cuts by it. That covers only the first sort key today, so it would need compound keys. The driver-side sampler, SampleExec and its codec would then go away.
Additional context

The sampling is range_exchange in native/native-executors/src/assembly.rs and collect in src/frontend.rs.

Part of #7288.

Willingness to contribute

Yes. I can contribute this feature independently.

主要语言
Scala
星标
1.3k
派生
405
平均合并
3 天 1 小时
30 天内合并 PR
277

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/datafusion-comet 的其他 Issue

查看 apache/datafusion-comet 的全部 Issue

相似的 Issue

更多 Scala Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。