You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "neilconway (via GitHub)" <gi...@apache.org> on 2026/09/30 16:21:31 UTC

[PR] fix: Avoid special-casing `count(1)` in `Count::value_from_stats` [datafusion]

neilconway opened a new pull request, #25911:
URL: https://github.com/apache/datafusion/pull/25911

   ## Which issue does this PR close?
   
   - N/A
   
   ## Rationale for this change
   
   `Count::value_from_stats` previously had a special-case to take advantage of the fact that `count(1)` is equivalent to a row-count. Generalize that slightly:
   
   * `count(k)` for any non-null constant is equivalent to a row count
   * `count(NULL)` is equivalent to 0
   
   ## What changes are included in this PR?
   
   * Generalize `Count::value_from_stats` as described above
   * Update expected SLT plan shapes
   * Add new SLT test
   
   ## What is the testing strategy for this PR?
   
   Exising tests pass, new test added. I confirmed that the changes to the plan shapes are consistent with the intent behind each of the SLTs in question.
   
   ## Are there any user-facing changes?
   
   No.
   


-- 
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-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] fix: Avoid special-casing `count(1)` in `Count::value_from_stats` [datafusion]

Posted by "neilconway (via GitHub)" <gi...@apache.org>.
neilconway merged PR #25911:
URL: https://github.com/apache/datafusion/pull/25911


-- 
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-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] fix: Avoid special-casing `count(1)` in `Count::value_from_stats` [datafusion]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #25911:
URL: https://github.com/apache/datafusion/pull/25911#issuecomment-5917442034

   ## [Codecov](https://app.codecov.io/gh/apache/datafusion/pull/25911?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `80.00000%` with `1 line` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 82.60%. Comparing base ([`6924c6a`](https://app.codecov.io/gh/apache/datafusion/commit/6924c6a5d45f013f37a2a293387bc6dac7f3d217?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`5ad7b3c`](https://app.codecov.io/gh/apache/datafusion/commit/5ad7b3c7b8f80dab81dde3160180a43ce903c09e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/datafusion/pull/25911?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [datafusion/functions-aggregate/src/count.rs](https://app.codecov.io/gh/apache/datafusion/pull/25911?src=pr&el=tree&filepath=datafusion%2Ffunctions-aggregate%2Fsrc%2Fcount.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZGF0YWZ1c2lvbi9mdW5jdGlvbnMtYWdncmVnYXRlL3NyYy9jb3VudC5ycw==) | 80.00% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/datafusion/pull/25911?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##             main   #25911      +/-   ##
   ==========================================
   - Coverage   82.60%   82.60%   -0.01%     
   ==========================================
     Files        1144     1144              
     Lines      442793   442794       +1     
     Branches   442793   442794       +1     
   ==========================================
   - Hits       365779   365775       -4     
   - Misses      54863    54864       +1     
   - Partials    22151    22155       +4     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/datafusion/pull/25911?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org