adriangb commented on code in PR #26056:
URL: https://github.com/apache/datafusion/pull/26056#discussion_r4356739715
##########
datafusion/physical-expr/src/expressions/dynamic_filters/mod.rs:
##########
@@ -343,6 +344,31 @@ impl DynamicFilterPhysicalExpr {
Ok(())
}
+ /// Reset this dynamic filter so its producer can publish a new expression
+ /// during a later execution of the same plan.
+ pub fn reset(&self) -> Result<()> {
+ let new_expr = Self::remap_children(
+ &self.children,
+ self.remapped_children.as_ref(),
+ lit(true),
+ )?;
+
+ let mut current = self.inner.write();
+ let new_generation = current.generation + 1;
+ *current = Inner {
Review Comment:
why not reset the generation to 0? @jayzhan211 is it obvious to you? if it's
not lets add a comment.
##########
datafusion/physical-expr/src/expressions/dynamic_filters/mod.rs:
##########
@@ -343,6 +344,31 @@ impl DynamicFilterPhysicalExpr {
Ok(())
}
+ /// Reset this dynamic filter so its producer can publish a new expression
+ /// during a later execution of the same plan.
+ pub fn reset(&self) -> Result<()> {
+ let new_expr = Self::remap_children(
+ &self.children,
+ self.remapped_children.as_ref(),
+ lit(true),
+ )?;
+
+ let mut current = self.inner.write();
+ let new_generation = current.generation + 1;
+ *current = Inner {
+ expression_id: current.expression_id,
+ generation: new_generation,
+ expr: new_expr,
+ is_complete: false,
+ };
+ drop(current);
+
+ let _ = self.state_watch.send(FilterState::InProgress {
+ generation: new_generation,
+ });
Review Comment:
Same here, why send this message and why this generation vs. e.g. `0`?
--
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]