You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2015/05/16 00:00:59 UTC

[jira] [Resolved] (CALCITE-731) Incorrect results from GROUPING SETS

     [ https://issues.apache.org/jira/browse/CALCITE-731?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Hyde resolved CALCITE-731.
---------------------------------
    Resolution: Invalid

My mistake. The query is giving correct results. To get the results I intended, I should have put parentheses around the grouping sets: {code}select grouping(deptno), deptno, loc
from scott_clone.dept
group by grouping sets ((deptno), (loc));{code}

> Incorrect results from GROUPING SETS
> ------------------------------------
>
>                 Key: CALCITE-731
>                 URL: https://issues.apache.org/jira/browse/CALCITE-731
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>
> Queries with GROUPING SETS do not seem to be returning grand totals. For example, using the schema of CALCITE-729, {noformat}> select grouping(deptno), deptno, loc from scott_clone.dept group by grouping sets (deptno), (loc);
> +------------+--------+---------------+
> |   EXPR$0   | DEPTNO |      LOC      |
> +------------+--------+---------------+
> | 1          | 10     | NEW YORK      |
> | 1          | 30     | CHICAGO       |
> | 1          | 40     | BOSTON        |
> | 1          | 20     | DALLAS        |
> +------------+--------+---------------+
> 4 rows selected (0.079 seconds){noformat}
> There should be a row which gives the grand total for all DEPTNO values, and a row which gives the grand total for all LOC values.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)