vim89 opened a new pull request, #16941: URL: https://github.com/apache/datafusion/pull/16941
## Which issue does this PR close? - Partially closes #15873 ## Rationale for this change `EmptyExec` previously returned **"unknown"** statistics for both global and partition-level queries, which impacts planner accuracy. This change provides exact-zero stats for EmptyExec, aligning with how other operators like `AggregateExec` and `PlaceholderRowExec` handle partition statistics. ## What changes are included in this PR? - Implemented `partition_statistics(...)` for `EmptyExec`: - Sets `num_rows` and `total_byte_size` to `Precision::Exact(0)` - Populates `column_statistics` with one `ColumnStatistics::new_unknown()` per schema field - Added unit test `empty_multi_partition_statistics`: - Verifies default 1-partition behavior: global and partition 0 return zero stats, invalid partition errors - Verifies 2-partition behavior: partitions 0 and 1 return zero stats, invalid partition errors - Added a `TreeRender` branch to `DisplayAs` to provide informative display of the operator: `"EmptyExec: partitions=X, fields=Y"` - No other execution plans or tests were modified ## Are these changes tested? Yes. - New test covers all relevant edge cases. - The full test suite still passes without regressions. ## Are there any user-facing changes? No. This change affects internal planner behavior only; no public APIs or outputs are changed. -- 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