Is your feature request related to a problem or challenge?
COUNT(non_nullable_column) counts every row, but DataFusion still evaluates and reads the column unnecessarily.
Describe the solution you'd like
Rewrite safe, non-DISTINCT counts during logical simplification:
COUNT(non_nullable_column) -> COUNT(1)
Preserve the original output name and schema. For multi-argument COUNT, rewrite only when every argument is provably non-null.
Additional context
Split from #25849 as suggested in #25849 (comment).
Is your feature request related to a problem or challenge?
COUNT(non_nullable_column)counts every row, but DataFusion still evaluates and reads the column unnecessarily.Describe the solution you'd like
Rewrite safe, non-
DISTINCTcounts during logical simplification:Preserve the original output name and schema. For multi-argument
COUNT, rewrite only when every argument is provably non-null.Additional context
Split from #25849 as suggested in #25849 (comment).