You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2017/05/09 18:39:04 UTC

[jira] [Created] (CALCITE-1781) Allow expression in CUBE and ROLLUP

Julian Hyde created CALCITE-1781:
------------------------------------

             Summary: Allow expression in CUBE and ROLLUP
                 Key: CALCITE-1781
                 URL: https://issues.apache.org/jira/browse/CALCITE-1781
             Project: Calcite
          Issue Type: Bug
            Reporter: Julian Hyde
            Assignee: Julian Hyde


Currently we only allow columns as arguments to CUBE and ROLLUP operators, whereas we allow expressions in the GROUP BY clause. This change would also allow expressions as arguments to CUBE and ROLLUP. Example:

{code}
// the following are valid, and will remain valid
select deptno from emp group by deptno; 
select deptno +1 from emp group by deptno + 1;
select deptno from emp group by cube(deptno);
select deptno from emp group by rollup(deptno);

// the following are currently invalid, but would be valid
select deptno +1 from emp group by cube(deptno + 1, empno - 1);
select deptno +1 from emp group by rollup(deptno + 1, empno - 1);
{code}

Note that as of CALCITE-1306, and with {{SqlConformance.isGroupByOrdinal}} enabled, {{select deptno from emp group by cube(1)}} should be valid because {{1}} is interpreted as an ordinal in the SELECT clause, not an expression.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)