[ https://issues.apache.org/jira/browse/CALCITE-5955?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17772373#comment-17772373 ]
Oliver Lee commented on CALCITE-5955: ------------------------------------- Sorry I think I'm getting sidetracked with the complex case. Here is the state of Calcite and what we would like to happen ||query name||ISO SQL ||ISO SQL Supported in Calcite?||ideal BQ translated SQL|| |input_1|select percentile_cont(0.5) within group (order by X)|Yes|select percentile_cont(0.5) over (order by x)| |input_2|select percentile_cont(0.5) within group (order by X) over (partition by y)|No|select percentile_cont(0.5) over (partition by y order by X)| | | | | | | | | | | To handle the simple case {{input_1}} , I will create a JIRA case for that and have a commit up. {{input_2}} in its ISO SQL form is not supported by Calcite so I will log 2 tickets, 1 to support it in Calcite and then 1 to do the BQ translation. > BigQuery PERCENTILE functions are unparsed incorrectly > ------------------------------------------------------ > > Key: CALCITE-5955 > URL: https://issues.apache.org/jira/browse/CALCITE-5955 > Project: Calcite > Issue Type: Bug > Reporter: Tanner Clary > Assignee: Tanner Clary > Priority: Major > Labels: pull-request-available > > Currently if you have a query like: > {{SELECT PERCENTILE_CONT(x, .5) OVER() FROM x;}} the {{OVER()}} clause gets > unparsed with a {{window frame clause}} which BigQuery defines > [here|https://cloud.google.com/bigquery/docs/reference/standard-sql/window-function-calls#def_window_frame]. > > From the docs: "Only aggregate analytic functions can use a window frame > clause." > This causes BigQuery to fail with the following error: {{Window framing > clause is not allowed for analytic function percentile_cont}} -- This message was sent by Atlassian Jira (v8.20.10#820010)