Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
The unit test in RelToSqlConverterTest:
@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\""); }
The generated SQL throws an exception in PG:
SELECT "sex", LISTAGG(DISTINCT CAST("patient"."id" AS VARCHAR), ',') AS "list"FROM "patient"GROUP BY "sex"
LISTAGG should be STRING_AGG.
Attachments
Issue Links
- is related to
-
CALCITE-5163 MysqlSqlDialect unparse LISTAGG aggregate function error
-
- Closed
-
- links to