Deduplicate bucket computation in width_bucket_interval_mdn_exact
メンテナーはふだん 1 日以内に返信
@nightcityblade がすでに取り組んでいます。
2026年10月14日 から。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 85/100
調査の方向性
spark/src/function/math/width_bucket.rs の width_bucket_interval_mdn_exact から始めてください。"only month" と "months equals" の分岐では、範囲外チェック、幅のガード、バケットのクランプが繰り返されています。2つの分岐を比べて、どの部分が異なるかを確認してください。主な違いは、x、l、h が f64 にどのように変換されているかです。変換済みの値を受け取り Option<i64> を返す共通ヘルパーを抽出し、両方の分岐からそれを呼び出すようにしてください。両方の分岐がヘルパーを使用し、既存の width_bucket テストが変更なしで通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem or challenge?
width_bucket_interval_mdn_exact (spark/src/function/math/width_bucket.rs#L300-L431) contains two near-identical blocks, "only month" (about L330-L366) and "months equals" (about L368-L424). Each repeats:
- the ascending/descending out-of-range checks (bucket
0ornum_buckets + 1), - the bucket-width computation with its zero / non-finite null guard,
- the floor-plus-one bucket clamp.
They differ only in how x, l and h are projected to f64 (months vs. day/nanosecond offset relative to l). Duplicated numeric edge-case handling like this is where a boundary fix ends up in only one copy.
Describe the solution you'd like
Extract fn bucket_from_f64(x: f64, l: f64, h: f64, num_buckets: i64, ascending: bool) -> Option<i64> (returning None for null). Each branch then only computes its projected (x, l, h) and calls it. Optionally move the per-row body into a helper returning Option<i64> so the continue chains disappear. The existing width_bucket tests cover the behaviour.
Describe alternatives you've considered
None.
Additional context
This is small and self-contained, a good first issue. Line references are pinned to commit 0d79252f61bd.
- 主要言語
- Rust
- スター
- 9.4k
- フォーク
- 2.5k
- 平均マージ
- 4日 13時間
- マージ済み PR(30日)
- 353
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/datafusion のほかの issue
-
[Bug] atan2 does not normalize -0.0 the way Spark does対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug spark
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/datafusion#26333 ·
メンテナーはふだん 1 日以内に返信
-
bug help wanted unparser
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/datafusion#26316 · コメント 1 件 ·
メンテナーはふだん 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
-
area/infra good first issue type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
cristim/AztecCraft#92 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
charles-hood/DiagramCraft#51 ·
-
S: Untriaged T: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
libnyanpasu/clash-nyanpasu#5788 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
area:cli bug good first issue priority:medium
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信