Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactors on TreeNode Implementations #8395

Merged
merged 5 commits into from
Dec 2, 2023
Merged

Refactors on TreeNode Implementations #8395

merged 5 commits into from
Dec 2, 2023

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 Physical Expressions 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
23 checks passed
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 <[email protected]>
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 Physical Expressions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants