2010YOUY01 opened a new issue, #12058:
URL: https://github.com/apache/datafusion/issues/12058

   ### Describe the bug
   
   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 
574dfeb29)
   ```
   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
   ```
   
   ### To Reproduce
   
   _No response_
   
   ### Expected behavior
   
   _No response_
   
   ### Additional context
   
   Found by SQLancer https://github.com/apache/datafusion/issues/11030


-- 
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]

Reply via email to