Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

MIN/MAX don't unwrap nested encodings inside Dictionary columns

オープン 初心者向け
#26,290 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
data

調査の方向性

get_min_max_result_type 関数から始めてください。ここでは RunEndEncoded の分岐がすでに値に対して再帰している一方、Dictionary の分岐は一段階しか展開していません。MIN/MAX のテストで、dictionary や run-end の列が MemTable 経由でどのように構築・問い合わせされるかを確認してください。両方のネストしたエンコーディングの列に対する max が、プレーンな UInt32 の値を UInt32 型で返し、それぞれのケースをテストでカバーできれば完了です。

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

説明

bug
Describe the bug

get_min_max_result_type recurses into RunEndEncoded values but unwraps Dictionary only one level. When a dictionary's values are themselves encoded, MIN/MAX don't reach the plain value type:

Column type max(c)
Dictionary<Int32, RunEndEncoded<Int32, UInt32>> Internal error: Min/Max accumulator not implemented for type RunEndEncoded(...)
Dictionary<Int32, Dictionary<Int32, UInt32>> correct value, typed Dictionary(Int32, UInt32) instead of UInt32
To Reproduce

arrow_cast can't build these types, so they only come from a TableProvider, e.g. a MemTable:

let values = RunArray::<Int32Type>::try_new(&Int32Array::from(vec![1, 2]), &UInt32Array::from(vec![1, 3]))?;
let column: ArrayRef = Arc::new(DictionaryArray::<Int32Type>::try_new(Int32Array::from(vec![0, 0, 1]), Arc::new(values))?);
// register `column` as `c` in a MemTable `t`, then:
ctx.sql("SELECT max(c) FROM t").await?.collect().await?; // internal error
Expected behavior

Both columns return max(c) = 3 as UInt32, the same as RunEndEncoded<_, Dictionary<_, UInt32>>.

Additional context

Follow-up to https://github.com/apache/datafusion/pull/26248#discussion_r4267916127. Making the Dictionary arm recurse like the RunEndEncoded arm fixes both cases:

DataType::Dictionary(_, values) => get_min_max_result_type(&[values.deref().clone()]),
Willingness to contribute

I plan to contribute a fix for this bug independently

主要言語
Rust
スター
9.4k
フォーク
2.5k
平均マージ
4日 9時間
マージ済み PR(30日)
329

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

apache/datafusion のほかの issue

apache/datafusion の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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