Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#26,290 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@grevend ci sta già lavorando.

Dal 15/10/2026.

  • #26371 di @grevend — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
data

Direzione di ricerca

Inizia dalla funzione get_min_max_result_type, dove il ramo RunEndEncoded già ricorre nei suoi valori mentre il ramo Dictionary scarta un solo livello. Controlla i test di MIN/MAX per vedere come una colonna dictionary o run-end viene costruita e interrogata tramite una MemTable. È completato quando max su entrambe le colonne a codifica annidata restituisce il valore UInt32 semplice, tipizzato come UInt32, con un test per ciascun caso.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Rust
Stelle
9.5k
Fork
2.5k
Merge medio
4g 14h
PR unite (30g)
315

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/datafusion

Tutte le issue di apache/datafusion

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.