[ https://issues.apache.org/jira/browse/CALCITE-6039?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17772681#comment-17772681 ]
Julian Hyde commented on CALCITE-6039: -------------------------------------- I suspect the best way to implement this is to leave the parser unchanged (or as unchanged as possible) and leave the interpretation of the AST (based on whether we are in BigQuery mode) to the validator. The logic will still be tricky. OVER applied to most aggregate functions makes the query a non-aggregate query, but applied to PERCENTILE_DISC in BigQuery it is an aggregate query. A good set of simple queries would be a good place to start. This would be a lot easier if PERCENTILE_CONT and PERCENTILE_DISC were implemented to the point where we could execute queries and get results. > PERCENTILE_CONT for BigQuery dialect has different syntax and is parsed > incorrectly > ----------------------------------------------------------------------------------- > > Key: CALCITE-6039 > URL: https://issues.apache.org/jira/browse/CALCITE-6039 > Project: Calcite > Issue Type: Bug > Reporter: Oliver Lee > Priority: Major > > For Big Query syntax, PERCENTILE_CONT uses the key word OVER instead of > WITHIN GROUP > See documentation > [here|https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#percentile_cont]. > There are a couple of issues incorrect with current parsing > * {{Parser.jj}} currently will incorrectly parses OVER into > {{SqlOverOperator}} (which is correct for other dialects, however not > entirely correct for Big Query) > * Should support: OVER(PARTITION BY y ORDER BY x) -- This message was sent by Atlassian Jira (v8.20.10#820010)