adriangb commented on PR #21157: URL: https://github.com/apache/datafusion/pull/21157#issuecomment-4187312946
> Just leaving some preliminary thoughts, let me know what you think: > > `PruningPredicate` uses `row_count` as total rows in `null_count != row_count` (all-null guard), but `all_required_expressions()`encodes row count as `count(*) FILTER (WHERE column IS NOT NULL`). > > A custom StatisticsSource can return non-null count for that expression, and then the all-null guard becomes wrong and can prune valid containers. Current blanket impl hides this by mapping that expression `to row_counts()`, but external implementations are exposed to this contract mismatch. > > We can either: > > * make the row-count expression unambiguous for total rows, or > > * clearly document/enforce that this specific filtered count expression is an alias for total row_counts. I think this is very valid. It's sort of the price we pay for these abstractions. But also `row_count` in particular should just be `count(*)` I think. I've added helpers for the "well known" expressions and fixed row count. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
