[
https://issues.apache.org/jira/browse/CALCITE-6866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17952002#comment-17952002
]
Yu Xu commented on CALCITE-6866:
--------------------------------
I noticed that the issue is staled for monthes and there is no clear next
steps, so I assgined it to me. If others want to have a try please let me know
for feel. The related PR can review when you are free, thanks [~nobigo]
> 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)