-
Notifications
You must be signed in to change notification settings - Fork 1.8k
refactor: merge CoalesceAsyncExecInput into CoalesceBatches #18540
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
Merged
Jefffrey
merged 4 commits into
apache:main
from
Tim-53:18155-fold-coalesceasyncexecinput-into-coalescebatches
Nov 11, 2025
+19
−81
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
28a0f3a
refactor: remove CoalesceAsyncExecInput and integrate its functionali…
Tim-53 e80a077
Merge branch 'main' into 18155-fold-coalesceasyncexecinput-into-coale…
Tim-53 ecb2d3d
remove redundant entries for coalesce_async_exec_input in explain.slt
Tim-53 4905819
add clarifying comment
Tim-53 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
71 changes: 0 additions & 71 deletions
71
datafusion/physical-optimizer/src/coalesce_async_exec_input.rs
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add it to the expression for
wrap_in_coalescebefore? E.g.|| plan_any .downcast_ref::<AsyncFuncExec>() .map(|f| ...etc.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered adding it at first, but I realized that inside
AsyncFuncExec, theCoalesceBatchesExecis wrapped around the first child, whereas for the other operators it's wrapped around the entire plan.I'm not sure whether changing the order inside
AsyncFuncExecto match the others would have any impact, so I kept it as is for now.I'll look into it further, but if anyone already has context on why it’s done this way, I’d appreciate any insights.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the idea is that for async functions, we are specifically interested in batching together inputs to the function so ideally it is not called as often (which can be expensive for async function). Whereas for coalesce batches in general, it looks like it considers the output of a node and if it is too small it wraps that note in a coalesce.
So for async, we consider input to aync node for coalesce logic; for other node types we look at their output for coalesce logic
We should copy the comment from
coalesce_async_exec_input.rshere to not lose that context, e.g.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick reply. Just added the comment.