Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
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
- Blocked
-
CALCITE-5920 Reset PERCENTILE_CONT/PERCENTILE_DISC to reserved keywords
- Closed
-
CALCITE-5909 SqlParserTest.testNoUnintendedNewReservedKeywords fails in IDE while passes in command line
- Closed
- relates to
-
CALCITE-5920 Reset PERCENTILE_CONT/PERCENTILE_DISC to reserved keywords
- Closed
- links to