tustvold commented on code in PR #4679:
URL: https://github.com/apache/arrow-datafusion/pull/4679#discussion_r1053292463
##########
benchmarks/src/bin/nyctaxi.rs:
##########
@@ -119,14 +118,11 @@ async fn datafusion_sql_benchmarks(
}
async fn execute_sql(ctx: &SessionContext, sql: &str, debug: bool) ->
Result<()> {
- let plan = ctx.create_logical_plan(sql)?;
- let plan = ctx.optimize(&plan)?;
+ let dataframe = ctx.sql(sql).await?;
if debug {
- println!("Optimized logical plan:\n{:?}", plan);
+ println!("Optimized logical plan:\n{:?}", dataframe.logical_plan());
}
- let physical_plan = ctx.create_physical_plan(&plan).await?;
- let task_ctx = ctx.task_ctx();
- let result = collect(physical_plan, task_ctx).await?;
Review Comment:
As ctx is interior mutable this would effectively plan, optimize, and
execute potentially against at least 3 different states :scream:
--
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]