Dandandan commented on a change in pull request #1063: URL: https://github.com/apache/arrow-datafusion/pull/1063#discussion_r728649214
########## File path: datafusion/src/physical_optimizer/aggregate_statistics.rs ########## @@ -276,6 +336,35 @@ mod tests { Ok(()) } + /// Checks that the count optimization was applied and we still get the right result + async fn assert_count_with_nulls_optim_success( + plan: HashAggregateExec, + ) -> Result<()> { + let conf = ExecutionConfig::new(); + let optimized = AggregateStatistics::new().optimize(Arc::new(plan), &conf)?; + + assert!(optimized.as_any().is::<ProjectionExec>()); Review comment: Maybe add a comment here that the added `ProjectionExec` is a sign the optimization was applied. -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org