[
https://issues.apache.org/jira/browse/CALCITE-7189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18020868#comment-18020868
]
Zhen Chen commented on CALCITE-7189:
------------------------------------
[~julianhyde] Thank you for your reply. I completely agree with you about
wrapping the non-group by columns with ANY_VALUE. As for the mode name, I might
want to call it NonStrictGroupBy mode. To be honest, I also thought of a very
suitable name.
> Support MySQL-style non-standard GROUP BY
> -----------------------------------------
>
> Key: CALCITE-7189
> URL: https://issues.apache.org/jira/browse/CALCITE-7189
> Project: Calcite
> Issue Type: New Feature
> Reporter: Zhen Chen
> Priority: Minor
>
> MySQL allows queries like SELECT a, b FROM t GROUP BY a; when
> ONLY_FULL_GROUP_BY is disabled, where columns in the SELECT list are not
> included in the GROUP BY clause or an aggregate function. In this loose mode,
> MySQL returns any value of b for each group.
> We can add an option to Calcite to support MySQL’s non-standard GROUP BY mode
> (like disabling ONLY_FULL_GROUP_BY), allowing non-aggregated columns in
> SELECT that are not present in GROUP BY.
> Example:
> {code:sql}
> SELECT a, b FROM t GROUP BY a;
> -- Should return one arbitrary 'b' value per group, as MySQL does in loose
> mode.
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)