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


##########
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:
   For example:
   A+B, we will get the coercion type C. After the first optimization, will get 
`cast(A AS C) + CAST(B AS C)`.
   After the second optimization, we may get the coercion type D from `cast(A 
AS C) + CAST(B AS C)`.



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