apache / apache/datafusion

Remove Arc<LogicalPlan> from LogicalPlan, stop copying LogicalPlans

Offen
#4,628 19 Kommentare 4 Reaktionen 1 zugewiesene Person Beansprucht von @tustvold Auf GitHub ansehen
enhancement
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? Please describe what you are trying to do.**

Related to #4627, the current representation of `LogicalPlan` contains `Arc` at various points, whilst this does reduce the cost of copying a `LogicalPlan` tree, it:

* Complicates rewrites by necessitating clones
* Results in double-boxing - `e.g. Vec>`
* Permits cycles and all the excitement that would entail
* Marginal overhead from additional atomics
* Unidiomatic is perhaps too strong, but it is strange for a tree datastructure to have shared ownership

**Describe the solution you'd like**

I would like to remove the `Arc`, replacing with `Box` where necessary. Methods that currently take `Arc` should be updated to take `LogicalPlan`.

**Describe alternatives you've considered**

**Additional context**

This likely wants to wait until we are cloning `LogicalPlan` less frequently

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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