Comet Native Executors: run LIMIT and top-K queries with a per-partition limit before the exchange

オープン
#7,365 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
scala

調査の方向性

Start with takeOrderedStage in CometNativeExecutorsExec.scala and trace how it handles CometTakeOrderedAndProjectExec; compare that special case with the proposed per-partition limit/top-K, single-partition exchange, and final native stage. Done means both operators are handled by the generic stage-graph builder and only per-partition limited rows cross the exchange.

索引モデルが issue の本文から書いたものです。

説明

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

On a Comet Native Executor cluster (#7289), a query with LIMIT, including Dataset.show(), fails: CometCollectLimitExec performs its own shuffle to one partition inside doExecuteColumnar, so it is not a native block, and the driver's stage-graph builder refuses it with "it does not run natively".

CometTakeOrderedAndProjectExec has the same shape. The prototype special-cases it as a stage that reads its child through a single-partition exchange and runs Comet's final top-K plan. Unless the child is a CometLocalTopKExec, the child's whole output crosses that one-partition exchange, where Comet on Spark runs a per-partition top-K first.

Describe the potential solution

Plan both operators as explicit native pieces, as Spark plans LocalLimit, then an exchange, then GlobalLimit: a block with a per-partition limit or top-K, a CometShuffleExchangeExec to a single partition, and a block with the final limit or top-K. The generic stage-graph builder then handles them without a special case, and only the first rows of each partition cross the exchange.

Additional context

The special case is takeOrderedStage in CometNativeExecutorsExec.scala. It calls finalNativePlan(inputPartitions = 2) only to select the sorting branch.

Part of #7288.

Willingness to contribute

Yes. I can contribute this feature independently.

主要言語
Scala
スター
1.3k
フォーク
405
平均マージ
2日 20時間
マージ済み PR(30日)
321

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/datafusion-comet のほかの issue

apache/datafusion-comet の issue をすべて見る

似ている issue

Scala の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。