lyne7-sc opened a new issue, #21299:
URL: https://github.com/apache/datafusion/issues/21299
### Describe the bug
`median` can return incorrect results in sliding window queries when the
frame retracts multiple values in the accumulator.
### To Reproduce
```sql
SELECT
x,
median(x) OVER (
ORDER BY x
RANGE BETWEEN 1 PRECEDING AND CURRENT ROW
) AS median_val
FROM (VALUES (1.0), (1.0), (2.0), (5.0)) AS t(x)
ORDER BY x;
```
Current result:
```
1 1
1 1
2 1
5 3.5
```
Expected result:
```
1 1
1 1
2 1
5 5
```
### Expected behavior
`median` should return the correct result for sliding window frames by
retracting every value that leaves the frame
### Additional context
_No response_
--
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]