This is an automated email from the ASF dual-hosted git repository. avantgardner pushed a commit to branch bg_aggregate_pushdown in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
commit 8301dd15450d3374b42368046c8f00ac22d6ff79 Author: Brent Gardner <[email protected]> AuthorDate: Tue Aug 1 12:47:53 2023 -0600 Add Logical plan --- datafusion/core/tests/sql/select.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/datafusion/core/tests/sql/select.rs b/datafusion/core/tests/sql/select.rs index 46f2be4320..1f5e6fdc3e 100644 --- a/datafusion/core/tests/sql/select.rs +++ b/datafusion/core/tests/sql/select.rs @@ -583,9 +583,18 @@ async fn parallel_query_with_limit() -> Result<()> { .sql("SELECT c3, max(c2) as max FROM test group by c3 order by max desc limit 2") .await?; - let plan = dataframe.create_physical_plan().await?; + let actual_logical_plan = format!("{:?}", dataframe.logical_plan()); + let expected_logical_plan = r#" +Limit: skip=0, fetch=2 + Sort: max DESC NULLS FIRST + Projection: test.c3, MAX(test.c2) AS max + Aggregate: groupBy=[[test.c3]], aggr=[[MAX(test.c2)]] + TableScan: test + "#.trim(); + assert_eq!(expected_logical_plan, actual_logical_plan); - let actual_physical_plan = displayable(plan.as_ref()).indent(true).to_string(); + let physical_plan = dataframe.create_physical_plan().await?; + let actual_physical_plan = displayable(physical_plan.as_ref()).indent(true).to_string(); let expected_physical_plan = r#" GlobalLimitExec: skip=0, fetch=2 SortPreservingMergeExec: [max@1 DESC], fetch=2 @@ -601,7 +610,7 @@ GlobalLimitExec: skip=0, fetch=2 "#.trim(); assert_eq!(expected_physical_plan, actual_physical_plan); - let batches = collect(plan, ctx.task_ctx()).await?; + let batches = collect(physical_plan, ctx.task_ctx()).await?; let actual_rows = format!("{}", pretty_format_batches(batches.as_slice())?); let expected = r#" +-------+-----+
