uwescience/datalogcompiler — pull request #97 by 7andrew7 (2014-01-15 06:46:46+00:00)
Title: Implement two-phase groupby's for simple aggregates

This PR adds an optimizer rule for trivially decomposable aggregates (sum, min, max, count). Each decomposable aggregate is paired with a "combiner" aggregate.

Along the way, I cleaned up the handling for GroupBy arguments to ensure that grouping terms always precede aggregation terms.

For average, we need to figure out how to pass around a tuple/array of intermediate results; @domoritz probably has some great design for this.