gabotechs commented on code in PR #18799:
URL: https://github.com/apache/datafusion/pull/18799#discussion_r2540879837
##########
datafusion/physical-expr/src/expressions/dynamic_filters.rs:
##########
@@ -57,6 +57,8 @@ struct Inner {
/// This is used for [`PhysicalExpr::snapshot_generation`] to have a cheap
check for changes.
generation: u64,
expr: Arc<dyn PhysicalExpr>,
+ /// Flag indicating whether all updates have been received and the filter
is complete.
+ is_complete: bool,
Review Comment:
I imagine that readers that could care about this `is_complete` method will
need to do some manual polling to this boolean checking wether is true or not.
This means that the best they can do is to have a loop that does some arbitrary
`tokio::time::sleep()` until the boolean flag is true.
Do you think this could be improved with something like a
`tokio::sync::watch` or a `tokio::sync::Notify`?
I imagine that consuming this flag would be something like:
```rust
dyn_filter.wait_complete().await;
```
Instead of something like:
```rust
loop {
if dyn_filter.is_complete() {
break;
}
tokio::time::sleep(Duration::arbitrary).await
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]