SPARK-1627: Support external aggregation by using Aggregator in Spark SQL

Hi there,

I made some changes per comments couple of days ago here:
https://github.com/apache/spark/pull/867#discussion_r13217803. Please take
another look. Thanks!

Best Regards,
Xiaofeng



On Sat, May 24, 2014 at 8:52 PM, Reynold Xin <notifications@github.com>
wrote:

> In sql/core/src/main/scala/org/apache/spark/sql/execution/Aggregate.scala:
>
> >
> >            override final def next(): Row = {
> > -            val currentEntry = hashTableIter.next()
> > -            val currentGroup = currentEntry.getKey
> > -            val currentBuffer = currentEntry.getValue
> > -
> > -            var i = 0
> > -            while (i < currentBuffer.length) {
> > -              // Evaluating an aggregate buffer returns the result.  No row is required since we
> > -              // already added all rows in the group using update.
> > -              aggregateResults(i) = currentBuffer(i).eval(EmptyRow)
> > -              i += 1
> > +            val entry = aggIter.next()
> > +            val group = entry._1
> > +            val data = entry._2
> > +
> > +            for (i <- 0 to data.length - 1) {
>
> again, while loop here.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/apache/spark/pull/867/files#r13029115>.
>