aoto-tech opened a new pull request, #25275: URL: https://github.com/apache/datafusion/pull/25275
## Which issue does this PR close? - Closes #25266. ## Rationale for this change For floating-point inputs, `percentile_cont` currently truncates the interpolation weight to six decimal places. A small but nonzero percentile such as `2.5e-7` therefore returns the lower input value instead of an interpolated result. ## What changes are included in this PR? I removed the integer quantization from the float path and apply the `f64` interpolation fraction directly. Decimal interpolation still uses the existing fixed precision; I renamed the constant to make that boundary explicit. I also use separately weighted terms when finite endpoints have opposite signs. The usual difference-based form stays in place otherwise, but it would overflow before applying the fraction for a range such as `-f64::MAX..=f64::MAX`. ## What is the testing strategy for this PR? I added a unit test that exercises the reported sub-millionth weight through `calculate_percentile` for Float16, Float32, and Float64. There is also a focused test for the opposite-extreme overflow path, plus an sqllogictest covering the three float types. Three existing expected values change because they previously included the six-decimal truncation error. I ran: - `cargo test --locked -p datafusion-functions-aggregate --lib -j 4` (234 passed) - `cargo test --locked -j 4 --test sqllogictests -- aggregate.slt` - `cargo fmt --all -- --check` I also ran Clippy for all targets in `datafusion-functions-aggregate`. With Rust 1.97 I had to allow the pre-existing `unnecessary_semicolon` warning in `datafusion/common/src/rounding.rs:257`; otherwise Clippy stops in that dependency before reaching this crate. ## Are there any user-facing changes? Yes. `percentile_cont` now preserves the full interpolation weight for floating-point inputs. There is no public API change. -- 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]
