apache / apache/datafusion

support: Date +/plus Int or date_add function

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

Descrizione

### Is your feature request related to a problem or challenge?

we have requirements related to the date operation, such as `date_add`, `date_sub`.

In the spark and mysql, the `date_add(start_date, value_expr)` function has been supported.
But in the datafusion, we only use the `expr + interval 'value' day` to support them.

In the mysql or the spark, the second args can be the expr, but the datafusion has no method to get the same target.

### Describe the solution you'd like

In the PG document, PG support `date +/plus integer`.

We can try to support this feature in the datafusion or in the kernel of arrow-rs.

### Describe alternatives you've considered

_No response_

### Additional context

cc @waitingkuo @alamb

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia tracciando la gestione delle espressioni di data e dell'aritmetica degli intervalli in DataFusion, quindi confronta il comportamento richiesto di date_add/date_sub con la semantica di PostgreSQL, Spark e MySQL. Determina se il supporto debba appartenere a DataFusion o ad arrow-rs. Il lavoro è completato quando le operazioni sulle date con valori costituiti da espressioni e il comportamento di date + integer funzionano in modo coerente, con test che coprono le forme richieste.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.