Fix dynamic filter is_used function #19734
Open
+8
−10
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.
Which issue does this PR close?
Rationale for this change
The:is_used() API incorrectly returned false for custom
DataSourceimplementations that didn't call reassign_expr_columns() -> with_new_children() . This causedHashJoinExecto skip computing dynamic filters even when they were actually being used.What changes are included in this PR?
Updated is_used() to check both outer and inner Arc counts
Are these changes tested?
Functionality is covered by existing test
test_hashjoin_dynamic_filter_pushdown_is_used. I was not sure if to add a repro since it would require adding a customDataSource, the current tests in datafusion/core/tests/physical_optimizer/filter_pushdown/mod.rs useFileScanConfigAre there any user-facing changes?
no