apache / apache/datafusion

Pass over udfs/physical expr that `strictly_order_preserving` and mark them as such

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

Descrizione

After this is merged:
- #23807

we now have a new property `strictly_order_preserving` that allow for more optimizations if the expression marked as keeping the same ordering

this property means that given expression `f` and 2 values from the input column `a` and `b` the following variants are kept:
1. `a.cmp(b) == f(a).cmp(f(b))`
2. nulls maps to nulls

Example of satisfying expression:
`cast(col_a as BIGINT)` where `col_a` is `INT` it is keeping the properties

Example of not satesfing:

`floor` - floor can not

`array_repeat(my_col, 2)` which might look like at first glance as keeping the property as well but in fact it does not.

the reason is that `array_repeat(null, 2)` will output list of 2 nulls which breaks the 2nd property that nulls must be kept as nulls

for more details on the property meaning and difference from `preserves_lex_ordering` see:
https://github.com/apache/datafusion/blob/1c3232ce2262523fb4043e7264185b2f8f929b0d/datafusion/expr-common/src/sort_properties.rs#L151-L198

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dalla definizione e dalla spiegazione di `strictly_order_preserving` in `datafusion/expr-common/src/sort_properties.rs`, alle righe indicate, quindi individua la gestione delle UDF e delle espressioni fisiche descritta nell’issue. Verifica quali espressioni soddisfano sia le regole di conservazione dell’ordinamento sia quelle di conservazione dei null; il lavoro è completato quando le espressioni idonee sono contrassegnate senza includere erroneamente casi come `floor` o `array_repeat`.

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

Valutazione

Stack tecnologico
rust
Ambito
databases
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Da chiarire
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.