Commit bef1368
authored
Simplify wait_complete function (#19937)
## Which issue does this PR close?
## Rationale for this change
The current v52 signature `pub async fn wait_complete(self: &Arc<Self>)`
(introduced in #19546) is a bit unergonomic. The method requires
`&Arc<DynamicFilterPhysicalExpr>`, but when working with `Arc<dyn
PhysicalExpr>`, downcasting only gives you `&DynamicFilterPhysicalExpr`.
Since you can't convert `&DynamicFilterPhysicalExpr` to
`Arc<DynamicFilterPhysicalExpr>`, the method becomes impossible to call.
The `&Arc<Self>` param was used to check` is_used()` via Arc strong
count, but this was overly defensive.
## What changes are included in this PR?
- Changed `DynamicFilterPhysicalExpr::wait_complete` signature from `pub
async fn wait_complete(self: &Arc<Self>)` to `pub async fn
wait_complete(&self)`.
- Removed the `is_used()` check from `wait_complete()` - this method,
like `wait_update()`, should only be called on filters that have
consumers. If the caller doesn't know whether the filter has consumers,
they should call `is_used()` first to avoid waiting indefinitely. This
approach avoids complex signatures and dependencies between the APIs
methods.
## Are these changes tested?
Yes, existing tests cover this functionality, I removed the "mock"
consumer from `test_hash_join_marks_filter_complete_empty_build_side`
and `test_hash_join_marks_filter_complete` since the fix in
#19734 makes is_used check the
outer struct `strong_count` as well.
## Are there any user-facing changes?
The signature of `wait_complete` changed.1 parent f819061 commit bef1368
File tree
2 files changed
+10
-17
lines changed- datafusion
- physical-expr/src/expressions
- physical-plan/src/joins/hash_join
2 files changed
+10
-17
lines changedLines changed: 10 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
279 | 283 | | |
280 | 284 | | |
281 | 285 | | |
| |||
287 | 291 | | |
288 | 292 | | |
289 | 293 | | |
290 | | - | |
291 | | - | |
| 294 | + | |
292 | 295 | | |
293 | 296 | | |
294 | 297 | | |
295 | 298 | | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
301 | 304 | | |
302 | 305 | | |
303 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5078 | 5078 | | |
5079 | 5079 | | |
5080 | 5080 | | |
5081 | | - | |
5082 | | - | |
5083 | | - | |
5084 | | - | |
5085 | | - | |
5086 | 5081 | | |
5087 | 5082 | | |
5088 | 5083 | | |
| |||
5132 | 5127 | | |
5133 | 5128 | | |
5134 | 5129 | | |
5135 | | - | |
5136 | | - | |
5137 | | - | |
5138 | | - | |
5139 | | - | |
5140 | 5130 | | |
5141 | 5131 | | |
5142 | 5132 | | |
| |||
0 commit comments