andygrove commented on code in PR #840:
URL: https://github.com/apache/datafusion-comet/pull/840#discussion_r1720990285


##########
native/core/src/execution/datafusion/planner.rs:
##########
@@ -1208,17 +1208,17 @@ impl PhysicalPlanner {
         // DataFusion Join operators keep the input batch internally. We need
         // to copy the input batch to avoid the data corruption from reusing 
the input
         // batch.
-        let left = if can_reuse_input_batch(&left) {
-            Arc::new(CopyExec::new(left, CopyMode::UnpackOrDeepCopy))
-        } else {
-            Arc::new(CopyExec::new(left, CopyMode::UnpackOrClone))
-        };
 
-        let right = if can_reuse_input_batch(&right) {
-            Arc::new(CopyExec::new(right, CopyMode::UnpackOrDeepCopy))
-        } else {
-            Arc::new(CopyExec::new(right, CopyMode::UnpackOrClone))
-        };
+        fn prep_join_input(plan: Arc<dyn ExecutionPlan>) -> Arc<dyn 
ExecutionPlan> {
+            if can_reuse_input_batch(&plan) {
+                Arc::new(CopyExec::new(plan, CopyMode::UnpackOrDeepCopy))
+            } else {
+                Arc::new(CopyExec::new(plan, CopyMode::UnpackOrClone))
+            }
+        }
+
+        let left = prep_join_input(left);
+        let right = prep_join_input(right);

Review Comment:
   code cleanup: no functional change



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