jayshrivastava commented on code in PR #20416:
URL: https://github.com/apache/datafusion/pull/20416#discussion_r2956617056
##########
datafusion/physical-expr/src/expressions/dynamic_filters.rs:
##########
@@ -180,18 +291,52 @@ impl DynamicFilterPhysicalExpr {
}
}
+ /// Create a new [`DynamicFilterPhysicalExpr`] from `self`, except it
overwrites the
+ /// internal state with the source filter's state.
+ ///
+ /// This is a low-level API intended for use by the proto deserialization
layer.
+ ///
+ /// # Safety
Review Comment:
Removed
##########
datafusion/proto/src/physical_plan/mod.rs:
##########
@@ -3918,24 +3936,51 @@ impl PhysicalProtoConverterExtension for
DeduplicatingDeserializer {
where
Self: Sized,
{
- if let Some(expr_id) = proto.expr_id {
- // Check cache first
- if let Some(cached) = self.cache.borrow().get(&expr_id) {
- return Ok(Arc::clone(cached));
+ // The entire expr is cached, so re-use it.
+ if let Some(expr_id) = proto.expr_id
+ && let Some(cached) = self.cache.borrow().get(&expr_id)
+ {
+ return Ok(Arc::clone(cached));
+ }
+
+ // Cache miss, we must deserialize the expr.
+ let mut expr =
+ parse_physical_expr_with_converter(proto, ctx, input_schema,
codec, self)?;
+
+ // Check if we need to share inner state with a cached dynamic filter
+ if let Some(dynamic_filter_id) = proto.dynamic_filter_inner_id {
Review Comment:
Removed downcasts
--
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]