NGA-TRAN commented on a change in pull request #337: URL: https://github.com/apache/arrow-datafusion/pull/337#discussion_r632084193
########## File path: datafusion/tests/sql.rs ########## @@ -2885,3 +2885,45 @@ async fn test_cast_expressions_error() -> Result<()> { Ok(()) } + +#[tokio::test] +async fn test_physical_plan_display_indent() { + let mut ctx = ExecutionContext::new(); + register_aggregate_csv(&mut ctx).unwrap(); + let sql = "SELECT c1, MAX(c12), MIN(c12) as the_min \ + FROM aggregate_test_100 \ + WHERE c12 < 10 \ + GROUP BY c1 \ + ORDER BY the_min DESC \ + LIMIT 10"; + let plan = ctx.create_logical_plan(&sql).unwrap(); + let plan = ctx.optimize(&plan).unwrap(); + + let physical_plan = ctx.create_physical_plan(&plan).unwrap(); + let expected = vec![ + "GlobalLimitExec: limit=10", + " SortExec: [the_min DESC]", + " ProjectionExec: expr=[c1, MAX(c12), MIN(c12) as the_min]", + " HashAggregateExec: mode=Final, gby=[c1], aggr=[MAX(c12), MIN(c12)]", + " MergeExec", + " HashAggregateExec: mode=Partial, gby=[c1], aggr=[MAX(c12), MIN(c12)]", + " CoalesceBatchesExec: target_batch_size=4096", + " FilterExec: c12 < CAST(10 AS Float64)", + " RepartitionExec: partitioning=RoundRobinBatch(16)", Review comment: Make sense. Thanks @Dandandan -- 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