[ 
https://issues.apache.org/jira/browse/CALCITE-4335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17217132#comment-17217132
 ] 

Julian Hyde commented on CALCITE-4335:
--------------------------------------

{{STRING_AGG}} (In BigQuery and PostgreSQL) is very similar to {{LISTAGG}} (in 
standard SQL and Oracle), and added to Calcite in CALCITE-2754. Let's implement 
{{STRING_AGG}} as an alias.

BigQuery {{STRING_AGG}} syntax:
{code}STRING_AGG([DISTINCT] expression [, delimiter]
   [ORDER BY key [{ASC|DESC}] [, ... ]]  [LIMIT n]){code}

The PostgreSQL syntax is similar but does not allow {{LIMIT}}.

Calcite {{LISTAGG}} syntax:
{code}LISTAGG([DISTINCT] expression [, delimiter])
  [WITHIN GROUP  (ORDER BY key [{ASC|DESC}] [, ... ])]{code}

> Aggregate functions for BigQuery
> --------------------------------
>
>                 Key: CALCITE-4335
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4335
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Priority: Major
>
> Add aggregate functions for BigQuery 
> ([spec|https://cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_functions]):
>  {{ARRAY_AGG}}, {{ARRAY_CONCAT_AGG}}, {{COUNTIF}}, {{LOGICAL_AND}}, 
> {{LOGICAL_OR}}, {{STRING_AGG}}.
> Calcite already has {{ANY_VALUE}}, {{BIT_AND}}, {{BIT_OR}}, {{BIT_XOR}}, 
> {{MAX}}, {{MIN}}, {{SUM}} aggregate functions.
> (Edit, 2020/10/15: And, since CALCITE-2935 is fixed, it now has 
> {{LOGICAL_AND}}, {{LOGICAL_OR}}.)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to