[
https://issues.apache.org/jira/browse/CALCITE-6866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17931818#comment-17931818
]
Sagar Rao commented on CALCITE-6866:
------------------------------------
hi [~nobigo] can i take this up plz?
> PostgreSQLDialect support to unparse LISTAGG aggregate function
> ---------------------------------------------------------------
>
> Key: CALCITE-6866
> URL: https://issues.apache.org/jira/browse/CALCITE-6866
> Project: Calcite
> Issue Type: Bug
> Reporter: xiong duan
> Priority: Major
>
> The unit test in RelToSqlConverterTest:
> {code:java}
> @Test void testPostgresqlLISTAGG() {
> final String query = "SELECT \"product_class_id\","
> + "LISTAGG(DISTINCT CAST(\"brand_name\" AS VARCHAR), ',') "
> + "FROM \"foodmart\".\"product\" group by \"product_class_id\"";
> sql(query).withPostgresql().ok("SELECT \"product_class_id\",
> LISTAGG(DISTINCT CAST(\"brand_name\" AS VARCHAR), ',')\n"
> + "FROM \"foodmart\".\"product\"\nGROUP BY \"product_class_id\"");
> } {code}
> The generated SQL throws an exception in PG:
> {code:java}
> SELECT "sex", LISTAGG(DISTINCT CAST("patient"."id" AS VARCHAR), ',') AS
> "list"FROM "patient"GROUP BY "sex" {code}
> LISTAGG should be STRING_AGG.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)