Dandandan commented on a change in pull request #9639: URL: https://github.com/apache/arrow/pull/9639#discussion_r588625713
########## File path: rust/datafusion/src/execution/context.rs ########## @@ -1702,6 +1702,23 @@ mod tests { } Ok(()) } + #[test] + fn ctx_sql_should_optimize_plan() -> Result<()> { + let mut ctx = ExecutionContext::new(); + let plan1 = + ctx.create_logical_plan("SELECT * FROM (SELECT 1) WHERE TRUE AND TRUE")?; + + let opt_plan1 = ctx.optimize(&plan1)?; + + let plan2 = ctx.sql("SELECT * FROM (SELECT 1) WHERE TRUE AND TRUE")?; Review comment: Before the PR the test fails, as it doesn't optimize the plan. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org