parthchandra commented on code in PR #1793:
URL: https://github.com/apache/datafusion-comet/pull/1793#discussion_r2109601362


##########
spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala:
##########
@@ -2406,19 +2406,19 @@ object QueryPlanSerde extends Logging with 
CometExprShim {
 
           // TODO this could be optimized more to stop walking the tree on 
hitting
           //  certain operators such as join or aggregate which will copy 
batches
-          def containsNativeCometScan(plan: SparkPlan): Boolean = {
+          def containsNonDataFusionScan(plan: SparkPlan): Boolean = {
             plan match {
-              case w: CometScanWrapper => 
containsNativeCometScan(w.originalPlan)
-              case scan: CometScanExec => scan.scanImpl == 
CometConf.SCAN_NATIVE_COMET
+              case _: CometScanWrapper => true
+              case scan: CometScanExec => scan.scanImpl != 
CometConf.SCAN_NATIVE_DATAFUSION
               case _: CometNativeScanExec => false
-              case _ => plan.children.exists(containsNativeCometScan)
+              case _ => plan.children.isEmpty || 
plan.children.exists(containsNonDataFusionScan)

Review Comment:
   > ScanExec of rust and not ScanExec of DataFusion
   
   what does this mean?



##########
native/core/src/execution/planner.rs:
##########
@@ -956,6 +956,12 @@ impl PhysicalPlanner {
                     self.create_expr(filter.predicate.as_ref().unwrap(), 
child.schema())?;
 
                 let filter: Arc<dyn ExecutionPlan> = if 
filter.use_datafusion_filter {
+                    assert_eq!(
+                        scans.len(),
+                        0,
+                        "Must not use ScanExec as it may requires a copy"
+                    );
+

Review Comment:
   That is correct. `native_iceberg_compat` does not reuse buffers. 



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to