UBarney commented on code in PR #15954: URL: https://github.com/apache/datafusion/pull/15954#discussion_r2104159225
########## datafusion/physical-plan/src/aggregates/mod.rs: ########## @@ -751,28 +771,16 @@ impl AggregateExec { }) } _ => { - // When the input row count is 0 or 1, we can adopt that statistic keeping its reliability. + // When the input row count is 1, we can adopt that statistic keeping its reliability. // When it is larger than 1, we degrade the precision since it may decrease after aggregation. - let num_rows = if let Some(value) = self - .input() - .partition_statistics(None)? - .num_rows - .get_value() + let num_rows = if let Some(value) = child_statistics.num_rows.get_value() { - if *value > 1 { - self.input() - .partition_statistics(None)? - .num_rows - .to_inexact() - } else if *value == 0 { - // Aggregation on an empty table creates a null row. Review Comment: https://github.com/apache/datafusion/blob/aa62950b7b288efc7eac4754aa54de29a5d28d93/datafusion/core/tests/physical_optimizer/partition_statistics.rs#L636-L662 -- 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...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org