Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
CALCITE-4349 supports GROUP_CONCAT aggregate function. The code translated GROUP_CONCAT to LISTAGG during sql_to_rel.
But, MysqlSqlDialect keep LISTAGG after uparsing query's relnode, the result sql couldn't be executed in MySQL engine.
I expect the following test case to be successful, but it's failed.
// test in org.apache.calcite.rel.rel2sql.RelToSqlConverterTest @Test void testMySqlGroupConcat() { final String query = "select\n" + "listagg(distinct \"product_name\", ',') within group(order by \"cases_per_pallet\")" + "from \"product\"\n" + "group by \"product_id\"\n"; final String expected = "SELECT GROUP_CONCAT(DISTINCT `product_name` ORDER BY " + "`cases_per_pallet` IS NULL, `cases_per_pallet` SEPARATOR ',')\n" + "FROM `foodmart`.`product`\n" + "GROUP BY `product_id`"; sql(query).withMysql().ok(expected); }
Attachments
Issue Links
- Blocked
-
CALCITE-4349 Support GROUP_CONCAT aggregate function for MySQL
- Closed
- links to