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 Tue, 16 Jun 2009 04:54:07 GMT

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

Bryan Pendleton updated DERBY-3002:

    Attachment: rewriteGroupByRS.diff

I've been spending a lot of time thinking about how to avoid unnecessary
sorts in the ROLLUP case, about how to handle DISTINCT aggregates,
and about how to handle the already-in-sorted-order case.

The result is the attached 'rewriteGroupByRS.diff', which contains an
almost-completely-rewritten GroupedAggregateResultSet.java, together
with a lot of new test cases in OLAPTest.java.

The new code no longer uses the sort-observer style of aggregate
computation. Instead, the code sorts the input data once, if it isn't already
in sorted order, then computes all the aggregates, at all the ROLLUP levels,
in a single pass over the (sorted) input data. DISTINCT aggregates are
processed using in-memory hash tables of the unique values, which
means that we can now support multiple DISTINCT aggregates in
a GROUP BY statement. (However, I'm not sure that DISTINCT aggregates
are really very useful, so I'm not sure that this is very much of a compelling
new feature.)

There are still some bugs in the code, as I have about 6 total failures in
the regression suites that I have to track down and study.

But, I think that this is a substantial improvement over the previous patch,
as it handles the major unresolved issues from the previous reviews:
 - multiple sorts are no longer needed
 - in-order data now works correctly with ROLLUP 
 - DISTINCT aggregates now work correctly with ROLLUP

The patch isn't ready for commit, and probably isn't worth reviewing, at least
until I get the regression test failures resolved, and take a pass over the patch
to resolve any FIXME comments that I left in it.

However, any feedback is most appreciated!

> Add support for GROUP BY ROLLUP
> -------------------------------
>                 Key: DERBY-3002
>                 URL: https://issues.apache.org/jira/browse/DERBY-3002
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions:
>            Reporter: Bryan Pendleton
>            Assignee: Bryan Pendleton
>            Priority: Minor
>         Attachments: fixWhiteSpace.diff, IncludesASimpleTest.diff, prototypeChangeNoTests.diff,
rewriteGroupByRS.diff, rollupNullability.diff, useLookahead.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