LLDay commented on code in PR #20009:
URL: https://github.com/apache/datafusion/pull/20009#discussion_r2757535813


##########
datafusion/physical-plan/src/joins/hash_join/exec.rs:
##########
@@ -1384,6 +1386,55 @@ impl ExecutionPlan for HashJoinExec {
         }
         Ok(result)
     }
+
+    fn physical_expressions<'a>(
+        &'a self,
+    ) -> Option<Box<dyn Iterator<Item = Arc<dyn PhysicalExpr>> + 'a>> {
+        self.filter
+            .as_ref()
+            .map(|f| Box::new(std::iter::once(Arc::clone(&f.expression))) as 
Box<_>)
+    }
+
+    fn with_physical_expressions(
+        &self,
+        mut params: ReplacePhysicalExpr,
+    ) -> Result<Option<Arc<dyn ExecutionPlan>>> {
+        let expected_count = self.filter.iter().len();
+        let exprs_count = params.exprs.len();
+        assert_eq_or_internal_err!(
+            expected_count,
+            exprs_count,
+            "Inconsistent number of physical expressions for {}",
+            self.name()
+        );
+
+        let filter = self
+            .filter
+            .as_ref()
+            .zip(params.exprs.pop())
+            .map(|(f, expr)| {
+                JoinFilter::new(expr, f.column_indices.clone(), 
Arc::clone(&f.schema))
+            });
+
+        Ok(Some(Arc::new(Self {
+            left: Arc::clone(&self.left),
+            right: Arc::clone(&self.right),
+            on: self.on.clone(),
+            filter,
+            join_type: self.join_type,
+            join_schema: Arc::clone(&self.join_schema),
+            left_fut: Arc::clone(&self.left_fut),

Review Comment:
   >  So let's switch the semantic.
   
   If we choose the reset semantic, we should also reset the dynamic filters. 
But this means that if we want to resolve the placeholders once before 
executing, the dynamic filter will be lost and the query will run slower.



-- 
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]

Reply via email to