Oliver Lee created CALCITE-6036:
-----------------------------------

             Summary: Support WITHIN GROUP(ORDER BY x) OVER (PARTITION BY y) 
                 Key: CALCITE-6036
                 URL: https://issues.apache.org/jira/browse/CALCITE-6036
             Project: Calcite
          Issue Type: Bug
            Reporter: Oliver Lee


[According to Oracle in ISO 
SQL|https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/PERCENTILE_CONT.html#GUID-CA259452-A565-41B3-A4F4-DD74B66CEDE0],
 in functions such as PERCENTILE_CONT or PERCENTILE_DISC, it should support the 
clauses

{{WITHIN GROUP(ORDER BY x) OVER (PARTITION BY y)}} 

 

Currently, when trying to run a {{{}RelToSqlConverterTest{}}}, a sample query:
{quote}SELECT PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY product_class_id) 
OVER (PARTITION BY product_class_id) from food mart.product
{quote}
 

the validator will throw an error: {{OVER must be applied to aggregate 
function}} 

(PERCENTILE_CONT is not an aggregate function and any SqlOverOperator/RexOver 
requires the operator to be an aggregate function)) 

 

Desired behavior: 

The OVER clause should be able to be used in conjunction with the WITHIN GROUP 
clause

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to