feat: enable dynamic filter pushdown across serialization boundary#348
Closed
sesteves wants to merge 1 commit intodatafusion-contrib:mainfrom
Closed
feat: enable dynamic filter pushdown across serialization boundary#348sesteves wants to merge 1 commit intodatafusion-contrib:mainfrom
sesteves wants to merge 1 commit intodatafusion-contrib:mainfrom
Conversation
Two changes that work together to enable DataFusion's dynamic filter pushdown (TopK, HashJoin) in distributed execution: 1. PartitionIsolatorExec now forwards parent filters to its child, matching the pattern used by CoalesceBatchesExec, RepartitionExec, and other transparent passthrough nodes. 2. After plan deserialization on the worker, re-run FilterPushdown(Post) to reconnect fresh DynamicFilterPhysicalExpr Arcs from operators like SortExec(TopK) to the downstream DataSourceExec. Serialization snapshots dynamic filters into static expressions, breaking the shared Arc. This pass restores it, enabling runtime file pruning.
Collaborator
|
Thanks for taking the time to contribute! There is probably a better place for handling this than applying an optimization pass during execution. Doing this here seems more like a workaround for something that is better handled in DataFusion upstream. There's already efforts for accomplishing that, which seem like a better fit for solving this problem: |
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.
Summary
PartitionIsolatorExec now participates in filter pushdown: implements
gather_filters_for_pushdownandhandle_child_pushdown_resultto forward parent filters to its child unchanged, matching the pattern used by other transparent passthrough nodes (CoalesceBatchesExec, RepartitionExec).Re-run FilterPushdown(Post) after plan deserialization on workers: when the coordinator serializes an execution plan,
DynamicFilterPhysicalExprinstances are snapshotted into static expressions, breaking the sharedArcthat enables runtime file pruning. After deserialization indo_get, a post-optimizationFilterPushdownpass re-establishes the connection between operators likeSortExec(TopK)/HashJoinExecand the downstreamDataSourceExec.Added tests: unit test for
PartitionIsolatorExecfilter forwarding, and an integration-style test that verifies TopK dynamic filters survive the serialize → deserialize → optimize round-trip.