apache / apache/datafusion

manual repartitioning overridden by physical optimizer

Aperta
#3,629 6 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**

Using dataframe.repartition() function doesn't work as expected.

**To Reproduce**
Using the tpch bin from benchmarks, convert the .tbl (csv) files to Parquet format using the "partitions" option:

```
cargo run --release --bin tpch -- convert --input ./tpch-data --output ./tpch-data-parquet --format parquet --partitions 4
```

That should have produced 4 parquet files per table, but instead created 20 (this laptop has 20 cores).

**Expected behavior**

Expected it to produce the specified number of partitions (4 in this case).

**Additional context**
I added some debug and the physical plan produced is:
```
CoalesceBatchesExec: target_batch_size=4096
RepartitionExec: partitioning=RoundRobinBatch(20)
RepartitionExec: partitioning=RoundRobinBatch(4)
RepartitionExec: partitioning=RoundRobinBatch(20)
CsvExec: files=[home/kmitchener/dev/arrow-datafusion/benchmarks/tpch-data/region.tbl], has_header=false, limit=None, projection=[r_regionkey, r_name, r_comment]
```

The tpch bin repartitions the file using this bit of code:
```rust
// optionally, repartition the file
if opt.partitions > 1 {
csv = csv.repartition(Partitioning::RoundRobinBatch(opt.partitions))?
}
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia eseguendo il binario benchmarks/tpch con il comando di riproduzione e ispeziona il piano fisico intorno a dataframe.repartition(). Traccia il motivo per cui l’ottimizzatore fisico aggiunge repartition RoundRobinBatch(20) dopo la repartition richiesta in 4 partizioni. Il lavoro è completato quando il comando produce quattro file Parquet per tabella, come previsto.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.