Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-6036

Support WITHIN GROUP(ORDER BY x) OVER (PARTITION BY y)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      According to Oracle in ISO SQL, 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:

      SELECT PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY product_class_id) OVER (PARTITION BY product_class_id) from food mart.product

       

      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

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              oliverlee Oliver Lee
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: