You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Internal Error in APPROX_PERCENTILE_CONT window function (SQLancer) #12058
Using APPROX_PERCENTILE_CONT() aggregate as window function is supported now, but under certain case an internal error will be triggered.
See reproducer in datafusion-cli (compiled from latest main, commit is 574dfeb)
DataFusion CLI v41.0.0
> create table t1(v1 int);
insert into t1 values (1),(2),(3),(4),(5);
0 row(s) fetched.
Elapsed 0.108 seconds.
+-------+
| count |
+-------+
| 5 |
+-------+
1 row(s) fetched.
Elapsed 0.049 seconds.
> SELECT
APPROX_PERCENTILE_CONT(v1, 0.5) OVER (
ROWS BETWEEN 4 PRECEDING AND CURRENT ROW
)
FROM
t1;
+-------------------------------------------------------------------------------------+
| approx_percentile_cont(t1.v1,Float64(0.5)) ROWS BETWEEN 4 PRECEDING AND CURRENT ROW |
+-------------------------------------------------------------------------------------+
| 1 |
| 1 |
| 2 |
| 2 |
| 3 |
+-------------------------------------------------------------------------------------+
5 row(s) fetched.
Elapsed 0.040 seconds.
> insert into t1 values (6);
+-------+
| count |
+-------+
| 1 |
+-------+
1 row(s) fetched.
Elapsed 0.003 seconds.
> SELECT
APPROX_PERCENTILE_CONT(v1, 0.5) OVER (
ROWS BETWEEN 4 PRECEDING AND CURRENT ROW
)
FROM
t1;
Internal error: Retract should be implemented for aggregate functions when used with custom window frame queries.
This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker
Activity