`CoalescePartitionsExec::cardinality_effect` returns `Equal` when `fetch` is set
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
まず CoalescePartitionsExec::cardinality_effect とそのオペレーターの既存テストを見つけ、fetch が設定されている場合の動作を SortExec および SortPreservingMergeExec と比較してください。fetch がある場合とない場合のテストを追加または更新し、報告される効果がそれぞれ LowerEqual と Equal であることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
CoalescePartitionsExec::cardinality_effect always returns CardinalityEffect::Equal, which is documented as "the operator is guaranteed to produce exactly one row for each input row". When fetch is set, the operator can produce fewer rows than its input, so it should return CardinalityEffect::LowerEqual, as SortExec and SortPreservingMergeExec already do when they have a fetch.
Any code that relies on cardinality_effect gets the wrong answer for this operator. For example, PassthroughStatisticsProvider returns the input statistics unchanged for operators with CardinalityEffect::Equal, so a CoalescePartitionsExec with fetch = 10 over 1000 rows reports Exact(1000) instead of Exact(10).
To Reproduce
let plan = CoalescePartitionsExec::new(input).with_fetch(Some(10));
assert!(matches!(plan.cardinality_effect(), CardinalityEffect::LowerEqual)); // fails: Equal
Expected behavior
cardinality_effect returns CardinalityEffect::LowerEqual when fetch is set, and CardinalityEffect::Equal otherwise.
Additional context
Other readers of cardinality_effect are the physical optimizer rules sort_pushdown, topk_aggregation and limit_pushdown_past_window. I did not find a query that returns wrong results because of this, and no sqllogictest plan changes with the fix.
- 主要言語
- Rust
- スター
- 9.4k
- フォーク
- 2.5k
- 平均マージ
- 4日 13時間
- マージ済み PR(30日)
- 353
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/datafusion のほかの issue
-
bug help wanted unparser
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/datafusion#26316 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Deduplicate bucket computation in width_bucket_interval_mdn_exact対応中かも @nightcityblade が 1 日前に担当しました。 オープンenhancement good first issue help wanted spark tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
apache/datafusion#26307 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Use the shared aggr_test_schema in CSV scan tests instead of a local copy対応中かも @med9110 が 1 日前に担当しました。 オープンcore enhancement good first issue help wanted tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
apache/datafusion#26306 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
gcd benchmarks pass number_rows: 0 for 100k-row inputs対応中かも @med9110 が 1 日前に担当しました。 オープンbug functions good first issue help wanted tech debt
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
apache/datafusion#26297 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Struct union type coercion takes field nullability from the wrong field when field order differs対応中かも @med9110 が 1 日前に担当しました。 オープンbug help wanted logical-expr tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
apache/datafusion#26296 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
apache/datafusion の issue をすべて見る
似ている issue
-
priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
storytold/photocraft#6286 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Four problem loader browser tests fail on Windows対応中かも @Patriciaath999 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
original-bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
effort/S kind/docs
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
starkware-libs/sequencer#15229 ·
メンテナーはふだん 1 日以内に返信