Cannot cast `Large` Types to normal arrow types
- Lingua principale
- Rust
- Stelle
- 9.3k
- Fork
- 2.4k
- Merge medio
- 3g 11h
- PR unite (30g)
- 360
Descrizione
### Describe the bug
I am reading a parquet table, where one parquet file contains large arrow types, and one parquet file with normal arrow types. Datafusion doesn't like this and spits out an error that it cannot map the file schema to the table schema.
This even happens when I provide ParquetReadOptions with a schema that contains the normal arrow types. PyArrow for example has no issue reading these mixed large/normal types parquet table.
```rust
Plan("Cannot cast file schema field struct of type Struct([Field { name: \"x\", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: \"y\", data_type: LargeUtf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }]) to table schema field of type Struct([Field { name: \"x\", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: \"y\", data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }])")
```
https://github.com/delta-io/delta-rs/actions/runs/7045987181/job/19176836034?pr=1926
### To Reproduce
```rust
stream = context
.ctx
.read_parquet(locations, ParquetReadOptions::default().schema(&file_schema))
.await?;
.execute_stream()
.await?
.map_err(|err| {
ParquetError::General(format!("Z-order failed while scanning data: {:?}", err))
})
.boxed();
```
### Expected behavior
_No response_
### Additional context
_No response_
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia dalla chiamata a read_parquet usando ParquetReadOptions::schema(...), quindi segui l'errore di mappatura dello schema per i campi LargeUtf8 e Utf8 annidati. Riproducilo con i file parquet misti descritti nell'issue e verifica che la scansione abbia esito positivo quando lo schema della tabella usa tipi Arrow normali.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust
- 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