mesubash commented on issue #25266:
URL: https://github.com/apache/datafusion/issues/25266#issuecomment-6724784928
I'd like to pick up both this and #25267, since #25274 and #25275 were
closed. Both still reproduce on 55.0.0:
```sql
SELECT percentile_cont(x, CAST(2.5e-7 AS DOUBLE)) FROM (VALUES
(CAST(0.0 AS DOUBLE)), (CAST(1.0 AS DOUBLE)), (CAST(2.0 AS DOUBLE))) AS
t(x);
-- 0.0, expected 5e-7
SELECT percentile_cont(x, CAST(0.5 AS DOUBLE)) FROM (VALUES
(CAST(-1.7976931348623157e308 AS DOUBLE)), (CAST(1.7976931348623157e308 AS
DOUBLE))) AS t(x);
-- inf, expected 0.0
```
Both come from the same lines in `FloatInterpolator::interpolate`: the
weight is quantized to 1e-6, and `upper - lower` overflows for finite extremes.
My plan is to use the fraction directly as the weight for floats, keep the
quantization for decimals, and fall back to `lower * (1 - f) + upper * f` when
the difference isn't finite. Tests would cover the `WITHIN GROUP` form and the
window form, as @kosiew asked on the earlier PRs.
Since the change touches the same three lines, would you prefer one PR that
closes both issues, or two?
--
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]