apache / apache/datafusion

[Discuss] Different implementation style between Expr, LogicalPlan and ExecutionPlan

Aperta
#2,175 32 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)
362

Descrizione

**Is your feature request related to a problem or challenge? Please describe what you are trying to do.**

In current DataFusion code base, `Expr`, `LogicalPlan` and `ExecutionPlan` are represented in different ways. Actually they are all tree based structures. `Expr` and `LogicalPlan` are Enums, `ExecutionPlan` is a Trait.
The LogicalPlan enum wrapped the different logical operator structs like Projection and Filter, etc.

````
pub enum LogicalPlan {
Projection(Projection),
Filter(Filter),
............
}
````

But the Expr enum doesn't wrap the expression structs and define the different expressions directly in the enum.

````
pub enum Expr {
Alias(Box, String),
Column(Column),
............
AggregateFunction {
fun: aggregate_function::AggregateFunction,
args: Vec,
distinct: bool,
},
WindowFunction {
fun: window_function::WindowFunction,
args: Vec,
partition_by: Vec,
order_by: Vec,
window_frame: Option,
},
............
}
````

I think we should unify the coding style, at least the Expr and LogicalPlan representations should follow the same style. And for physical ExecutionPlan, it is Trait/Trait Objects, I would prefer to use Enum also. Want to hear thoughts from other members.

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia confrontando le definizioni di Expr, LogicalPlan ed ExecutionPlan descritte nell’issue ed esamina le rappresentazioni ad albero circostanti. L’issue è una discussione di progettazione piuttosto che un’attività di implementazione con un ambito delimitato; per completarla sarebbero necessari un accordo su una rappresentazione unificata e un ambito di migrazione definito.

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

Valutazione

Stack tecnologico
rust
Ambito
data-engineering
Tipo di issue
Refactoring
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
20/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.