[ https://issues.apache.org/jira/browse/CALCITE-5100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17525213#comment-17525213 ]
Roman Churganov edited comment on CALCITE-5100 at 4/20/22 6:51 PM: ------------------------------------------------------------------- function MIN() actually will be pushed to sub-query, but if some unsupported fun taken, with a simpler query it makes sub-query without aggregate: {code:sql} SELECT "DEPTNO", ', ' AS "$f1" FROM "EMP" {code} was (Author: rrrrrr111): with a simpler query it makes sub-query without aggregate: {code:sql} SELECT "DEPTNO", ', ' AS "$f1" FROM "EMP" {code} > Incorrect syntax in sub-query, unsupported LISTAGG > -------------------------------------------------- > > Key: CALCITE-5100 > URL: https://issues.apache.org/jira/browse/CALCITE-5100 > Project: Calcite > Issue Type: Bug > Components: core > Affects Versions: 1.30.0 > Reporter: Roman Churganov > Priority: Blocker > > Execute query like: > {code:sql} > select C11, LISTAGG( distinct C12, ', ' ) > from FOO > group by C11 > {code} > In case of JDBC driver doesn't support LISTAGG function (Postresql), JDBC > adapter creates subquery: > {code:sql} > SELECT "C11", "C12", ', ' AS "$f2" > FROM "FOO" > GROUP BY "C11", "C12", ', ' > {code} > which cannot be executed on Postresql and gives error : > {noformat} > [42601] ERROR: non-integer constant in GROUP BY > {noformat} > -- This message was sent by Atlassian Jira (v8.20.7#820007)