apache / apache/datafusion

Implement statistics support for Substrait

Offen
#8,698 7 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
enhancement substrait
Vorherrschende Sprache
Rust
Sterne
9.3k
Forks
2.4k
Ø Merge
3 T. 11 Std.
Gemergte PRs (30 T.)
360

Beschreibung

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

A report from Twitter https://twitter.com/mim_djo/status/1740542585410814393

Says:

> a new release of #datafusion 34, still reading #Deltatable via arrow is suboptimal compared to reading Parquet Directly :( something to do with passing stats to get correct join orders.

![image](https://github.com/apache/arrow-datafusion/assets/490673/c75637da-6408-461a-be27-513a13443c3f)

I think the issue is that https://github.com/apache/arrow-datafusion/issues/7949 and https://github.com/apache/arrow-datafusion/issues/7950 rely on statistics to pick non bad join orders for TPCH queries.

These statistics are not available from the delta provider it seems.

@andygrove says

> RelCommon (common to all operators in Substrait) can contain a hint that has stats

```
message Stats {
double row_count = 1;
double record_size = 2;
substrait.extensions.AdvancedExtension advanced_extension = 10;
}
```

### Describe the solution you'd like

I would like the Datafusion substrait consumer/producer to handle translating

### Describe alternatives you've considered

_No response_

### Additional context

This was brought up by @Dandandan on the ASF slack: https://the-asf.slack.com/archives/C04RJ0C85UZ/p1703885214702039

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, den DataFusion Substrait consumer und producer nachzuverfolgen, und lies anschließend die in der issue beschriebenen Substrait RelCommon- und Stats-Definitionen. Vergleiche, wie die Statistiken vom Delta provider dargestellt werden, und bestimme, welche Übersetzung erforderlich ist, damit die Auswahl der Join-Reihenfolge sie verwenden kann; als abgeschlossen gilt die Arbeit, wenn beide Seiten die Statistiken konsistent behandeln.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
backend
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Ruhig
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.