Describe the bug
select APPROX_PERCENTILE_CONT(v, 0.5) FROM (VALUES (1), (2), (3), (NULL), (NULL), (NULL)) as t (v);
+------------------------------------------+
| APPROX_PERCENTILE_CONT(t.v,Float64(0.5)) |
+------------------------------------------+
| 0 |
+------------------------------------------+
1 row in set. Query took 0.002 seconds.
To Reproduce
No response
Expected behavior
Should return 2 (answer without nulls). 0 is not input, so obviously incorrect, ignoring the nulls it should have given NULL
Following PostgreSQL query also gives 2:
SELECT percentile_cont(0.5) WITHIN GROUP(order by v) FROM (VALUES (1), (2), (3), (NULL), (NULL), (NULL)) as t (v);
Additional context
No response