coordinator: display dynamic filters after execution - #623
Draft
jayshrivastava wants to merge 6 commits into
Draft
coordinator: display dynamic filters after execution#623jayshrivastava wants to merge 6 commits into
jayshrivastava wants to merge 6 commits into
Conversation
jayshrivastava
force-pushed
the
js/1-display-dynamic-filters
branch
from
August 13, 2026 13:16
2a2bffc to
f549dc2
Compare
jayshrivastava
changed the base branch from
js/upgrade-df-55-08-10
to
branch-55
August 13, 2026 13:16
This was referenced Aug 13, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stack
This stack of PRs implements distributed dynamic filtering #528
Closes: #529
Problem
Post df-55 upgrade, dynamic filters should work in the worker-local case. There's no way to observe them working other than looking at metrics.
Ideally we want the final filters visible when displaying plans.
Solution
This PR adds a new protocol which is basically identical to the metrics protocol. Even the
MetricsStoreis now justStoreand is generic overTaskMetricsandTaskCompletedDynamicFilters(contains completed dynamic filters for a task).Similar to the metrics protocol, workers now collect completed dynamic filters and send them back to the coordinator.
Then, at display time, we call
apply_reports_to_distributed_leaveswhich traverses theplan_for_vizand updates the dynamic filters for all the variants:Notes
Duplicate RPC Messages
We will eventually have more dynamic filter RPCs which manage the worker -> coordinator -> merge -> worker flow mentioned in #553.
In theory, the coordinator will know at
mergetime what the completed filters are, making theTaskCompletedDynamicFiltersand final worker -> coordinator message in this PR irrelevant.However, I think having these mechanisms be separate is good because a) it helps us validate that the dynamic filter coordinator -> worker flow work using external "oracle", and b) there's no guarantee that the coordinator -> worker propagation happens before the query is done (ex. the
DataSourceExecmay not block execution waiting for dynamic filters), so it's good to have a separate way to know if the finalDataSourceExecapplied a filter or not.AND trueand empty filtersIn this filter
AND trueoccurs because of apache/datafusion#24277. The firstDynamicFilteris active but we lose theHashTableLookupExprwhen serializing it to send back to the coordinator.The 2nd filter is
DynamicFilter [ empty ]because this is a dynamic filter produced by a remote producer, which does not get propagated to this node yet.Testing