apache / apache/datafusion

Mismatch in timestamp format between dataframe and recordbatch when read from a delta table

Aperta
#7,564 4 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

I'm trying to read an pre-existing delta table (using delta-rs as the TableProvider) .

when I do `self.ctx.read_table(table).unwrap();` I get a dataframe where a timestamp field is `data_type: Timestamp(Microsecond, None)`.

Now I collect recordbatches by `df.collect().await;` here when I inspect the schema of a record batch I see that the datatype for the field has changed to `data_type: Timestamp(Nanosecond, None)`

When I use the DeltaTable writer (from delta.rs) its comparing doing a diff of the arrow schema's between the table and the recordbatch and this shows a mistmatch. the only difference was this and the write fails.

### To Reproduce

1. Create an deltatable (not using datafusion)
2. open it using deltafusion and collect the dataframe
3. compare the schema between the delta table and record bactch.
4

### Expected behavior

The recordbatch schema should be `data_type: Timestamp(Microsecond, None)`.

### Additional context

_No response_

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo la discrepanza con i passaggi read_table e df.collect() elencati, quindi esamina il percorso di conversione dello schema tra il DataFrame e il RecordBatch raccolto. Il lavoro è completato quando il timestamp raccolto rimane Timestamp(Microsecond, None), in modo che il confronto degli schemi del writer di DeltaTable abbia esito positivo.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.