Commit ce61816
committed
Fix dynamic filter is_used function (apache#19734)
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes apache#123` indicates that this PR will close issue apache#123.
-->
- Closes apache#19715.
## Rationale for this change
The:is_used() API incorrectly returned false for custom `DataSource`
implementations that didn't call reassign_expr_columns() ->
with_new_children() . This caused `HashJoinExec` to 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 custom `DataSource`, the
current tests in
datafusion/core/tests/physical_optimizer/filter_pushdown/mod.rs use
`FileScanConfig`
## Are there any user-facing changes?
no
(cherry picked from commit 278950a)1 parent bb4c587 commit ce61816
2 files changed
Lines changed: 8 additions & 10 deletions
File tree
- datafusion
- physical-expr/src/expressions
- physical-plan/src/joins/hash_join
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
| 320 | + | |
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
| 516 | + | |
| 517 | + | |
520 | 518 | | |
521 | 519 | | |
522 | 520 | | |
| |||
0 commit comments