You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jiajun Xie (Jira)" <ji...@apache.org> on 2023/02/10 09:36:00 UTC
[jira] [Commented] (CALCITE-5525) GROUPING_ID() should be rewritten to GROUPING() in some dialects
[ https://issues.apache.org/jira/browse/CALCITE-5525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17686983#comment-17686983 ]
Jiajun Xie commented on CALCITE-5525:
-------------------------------------
If other databases have the same problem, you can add it to the Jira ticket.
I will solve them in a unified way
> GROUPING_ID() should be rewritten to GROUPING() in some dialects
> ----------------------------------------------------------------
>
> Key: CALCITE-5525
> URL: https://issues.apache.org/jira/browse/CALCITE-5525
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Jiajun Xie
> Assignee: Jiajun Xie
> Priority: Minor
>
> Some databases not exists `grouping_id()`, `grouping()` is used as `grouping_id()`.
> - Postgresql
> {code:java}
> ERROR: function grouping_id(integer, character varying) does not exist
> LINE 1: select grouping(id), grouping(name), grouping_id(id, name), ...
> ^
> HINT: No function matches the given name and argument types. You might need to add explicit type casts
> {code}
> - Presto
> {code:java}
> Function grouping_id not registered
> {code}
>
> Here is a simple query, `grouping_id()` is a legal function in Spark.
> {code:java}
> select a,
> b,
> count(*),
> grouping(a) ga,
> grouping(b) gb,
> grouping_id(a, b)
> from (
> select 1 as a, 2 as b
> )
> group by grouping sets((a, b), (b), ())
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)