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

Add parsing and validation for PERCENTILE_CONT/PERCENTILE_DISC functions (enabled in BigQuery)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.35.0
    • None

    Description

      Calcite currently has implementations for the PERCENTILE_CONT and PERCENTILE_DISC functions. Their syntax may be found here.

      BigQuery offers these functions as well, but the syntax is slightly different, and may be found here. The main difference is that instead of using a WITHIN GROUP clause, the array is passed in directly as the first argument to the function.

      BigQuery Syntax Example: SELECT PERCENTILE_CONT(x, .5) OVER() FROM UNNEST([1,2,3,4]) as x; would return the median, 2.5.

      Standard Syntax Example: SELECT PERCENTILE_CONT(.5) WITHIN GROUP (ORDER BY [some column])

      Parsing and validation for the standard functions was added in CALCITE-4644.

      The actual implementation for both the standard and BigQuery forms is covered under CALCITE-4666.

      Attachments

        Issue Links

          Activity

            People

              tanclary Tanner Clary
              tanclary Tanner Clary
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: