andygrove commented on code in PR #3222:
URL: https://github.com/apache/arrow-datafusion/pull/3222#discussion_r954967018


##########
benchmarks/src/bin/tpch.rs:
##########
@@ -285,11 +285,12 @@ async fn execute_query(
     if debug {
         println!("=== Logical plan ===\n{:?}\n", plan);
     }
-    let plan = ctx.optimize(plan)?;
     if debug {
-        println!("=== Optimized logical plan ===\n{:?}\n", plan);
+        let optimized_plan = ctx.optimize(plan)?;
+        println!("=== Optimized logical plan ===\n{:?}\n", optimized_plan);
     }
-    let physical_plan = ctx.create_physical_plan(&plan).await?;
+    // note that `create_physical_plan` will optimize the plan so we pass the 
unoptimized plan

Review Comment:
   The original code was running the optimizer twice, which was not necessary. 
With the new rule there was a problem optimizing twice. I will look at this 
again today and write up an issue or make it safe to optimize twice.



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

Reply via email to