db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-3002) Add support for GROUP BY ROLLUP
Date Mon, 20 Aug 2007 22:23:31 GMT

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

Bryan Pendleton updated DERBY-3002:

    Attachment: prototypeChangeNoTests.diff

Attached is 'prototypeChangeNoTests.diff', which is *not* for commit.

This is an experimental change that I made to investigate a possible
implementation for GROUP BY ROLLUP(...).

This change:
 - modifies the parser to accept the new syntax
 - modifies GroupByList to have a boolean "rollup" flag
 - modifies the result set factory to pass the GroupByList's rollup
   setting down to the GroupedAggregateResultSet
- modifies GroupedAggregateResultSet to implement rollup
  processing by computing N total sorts, one for each level of the rollup.

I'm posting this work-in-process change in the hopes of getting some
feedback about whether this is a reasonable strategy for the overall implementation.

The change seems to work in some trivial tests, although there are
several bugs that I already know about:
 - it doesn't interact properly with index-driven no-sort-required aggregation
 - i'm not sure it handles DISTINCT aggregation properly
 - it doesn't do the "0th level" aggregation on *all* the columns in the rollup
However, it does seem to behave reasonably for the simple case of:
  SELECT c1,c2,c3,sum(c4) FROM t1 GROUP BY ROLLUP(c1,c2,c3)
so I felt sufficiently encouraged to post this partial patch in order to
give us some "real code" to discuss.

A particular issue that I'd like to get feedback on is whether the ROLLUP
case is worth implementing separately, or whether it would be better
to investigate the more general case of implementing GROUPING SETS
and CUBE() groupings as part of a single implementation.

> 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:
>            Reporter: Bryan Pendleton
>            Assignee: Bryan Pendleton
>            Priority: Minor
>         Attachments: 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.

View raw message