Skip to content

Conversation

berkaysynnada
Copy link
Contributor

@berkaysynnada berkaysynnada commented Dec 1, 2023

Which issue does this PR close?

Closes #.

Rationale for this change

Implementations in 3 places where TreeNode is used can be made more useful and understandable. This PR provides these refactorings. The approach in map_children(), where each node creates its own children and then propagates them, does not fit the patterns very well. In fact, before map_children() or apply_children() is called, there isn’t a tree available.

What changes are included in this PR?

Instead, we generate the entire tree with empty states using the trees' new() method. Each node now has its own child nodes initially. All transform operations are handled within the main transformer functions, and map_children() is only used to provide recursiveness.

Are these changes tested?

Covered by existing tests.

Are there any user-facing changes?

@github-actions github-actions bot added physical-expr Changes to the physical-expr crates core Core DataFusion crate labels Dec 1, 2023
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me -- thank you @berkaysynnada

@metesynnada metesynnada merged commit 075ff3d into apache:main Dec 2, 2023
appletreeisyellow pushed a commit to appletreeisyellow/datafusion that referenced this pull request Dec 14, 2023
* minor changes

* PipelineStatePropagator tree refactor

* Remove duplications by children_unbounded()

* Remove on-the-fly tree construction

* Minor changes

---------

Co-authored-by: Mustafa Akur <mustafa.akur@synnada.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate physical-expr Changes to the physical-expr crates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants