apache / apache/datafusion

optimizer panic with certain query(`count(count(x))/y`)

Aperta
#17,166 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Rust
Stelle
9.3k
Fork
2.4k
Merge medio
3g 11h
PR unite (30g)
360

Descrizione

### Describe the bug

This bug involve user defined node as leaf node and a slightly complex query, which will panic with `index out of bounds: the len is 2 but the index is 2` when trying to optimize this query.

this bug only appear in `datafusion="45.0.0"`, later version(>= 46.0.0) doesn't appear to have this bug, however I fail to found related fixes to it in changelog of 46.0.0, so put it in here just in case it isn't fully fixed.

### To Reproduce

Put lib.rs and Cargo.toml to a blank project and can reproduce this pnaic, backtrace also included

[backtrace.log](https://github.com/user-attachments/files/21751830/backtrace.log)
[lib.rs.txt](https://github.com/user-attachments/files/21751807/lib.rs.txt)
[Cargo.toml.txt](https://github.com/user-attachments/files/21751808/Cargo.toml.txt)

### Expected behavior

not panic

### Additional context

If this bug is clearly fixed in later version, could anyone point me to the pr that fix this? And feel free to close this issue in that case

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo il panic dai file allegati lib.rs.txt e Cargo.toml.txt con DataFusion 45.0.0, quindi confronta il comportamento con la versione 46.0.0 ed esamina il file allegato backtrace.log. Il lavoro è completato quando la query non provoca più un panic, oppure quando vengono identificati il fix esistente e la pull request correlata.

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

Valutazione

Stack tecnologico
rust, sql
Ambito
databases
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.