db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3002) Add support for GROUP BY ROLLUP
Date Mon, 06 Apr 2009 13:15:12 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12696072#action_12696072
] 

Knut Anders Hatlen commented on DERBY-3002:
-------------------------------------------

One more comment after testing the patch (yes, it still applies cleanly on trunk!):

The patch doesn't make ROLLUP a reserved keyword, so we can still have columns with that name
(which is good, I think). But we cannot group by a column named ROLLUP without quoting the
column name:

ij> create table t2(rollup int, x int);
0 rows inserted/updated/deleted
ij> select rollup, sum(x) from t2 group by rollup;
ERROR 42X01: Syntax error: Encountered "<EOF>" at line 1, column 45.
Issue the 'help' command for general information on IJ command syntax.
Any unrecognized commands are treated as potential SQL commands and executed directly.
Consult your DBMS server reference documentation for details of the SQL syntax supported by
your server.
ij> select rollup, sum(x) from t2 group by "ROLLUP";
ROLLUP     |2          
-----------------------

0 rows selected

I think this small incompatibility could be avoided by adding a lookahead in the grammar so
that we only try to parse it as a multi-level grouping clause if ROLLUP is followed by a left
parenthesis.

> Add support for GROUP BY ROLLUP
> -------------------------------
>
>                 Key: DERBY-3002
>                 URL: https://issues.apache.org/jira/browse/DERBY-3002
>             Project: Derby
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 10.4.1.3
>            Reporter: Bryan Pendleton
>            Assignee: Bryan Pendleton
>            Priority: Minor
>         Attachments: IncludesASimpleTest.diff, prototypeChangeNoTests.diff
>
>
> Provide an implementation of the ROLLUP form of multi-dimensional grouping according
to the SQL standard.
> See http://wiki.apache.org/db-derby/OLAPRollupLists for some more detailed information
about this aspect of the SQL standard.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message