Inconsistent `IS NOT NULL` filters for joins
- Lingua principale
- Rust
- Stelle
- 9.3k
- Fork
- 2.4k
- Merge medio
- 3g 11h
- PR unite (30g)
- 360
Descrizione
### Describe the bug
In the Dask-SQL project, we have relied on DataFusion to create `IS NOT NULL` filters at the `TableScan` level whenever a column is involved in a join. However, it looks like recent changes may have removed this feature?
### To Reproduce
The query
```
SELECT d_col
FROM c_table
JOIN d_table ON d_col=c_col
```
has the `LogicalPlan`
```
Projection: d_table.d_col
Inner Join: Filter: d_table.d_col = c_table.c_col
TableScan: c_table projection=[c_col]
TableScan: d_table projection=[d_col]
```
### Expected behavior
It still works when we write the query with a `WHERE` clause.
```
SELECT d_col
FROM c_table, d_table WHERE d_col=c_col
```
produces
```
Projection: d_table.d_col
Inner Join: c_table.c_col= d_table.d_col
TableScan: c_table projection=[c_col], full_filters=[c_table.c_col IS NOT NULL]
TableScan: d_table projection=[d_col], full_filters=[d_table.d_col IS NOT NULL]
```
### Additional context
I'm not quite sure when this change was introduced and if so, why? Is this something that DataFusion would be willing to fix, or would it be preferred that Dask-SQL re-adds the optimizer rule on our side?
cc @ayushdg @jdye64
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia eseguendo i due esempi SQL e confrontando il relativo output LogicalPlan, in particolare i full_filters di TableScan. Traccia la regola dell’ottimizzatore o la modifica di DataFusion che gestisce i predicati di join rispetto ai predicati WHERE. Il lavoro è concluso quando i filtri IS NOT NULL previsti vengono prodotti in modo coerente, oppure quando è stata chiarita la responsabilità di questo comportamento tra DataFusion e Dask-SQL.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust, sql
- Ambito
- data-engineering, 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