blob: 2bbc67d2a4b44c60da9882bd95e7b7c289c8fc20 [file] [log] [blame]
package com.gemstone.gemfire.cache.query.internal.aggregate;
/**
* Computes the final average of distinct values for the partitioned region
* based queries. This aggregator is initialized on the PR query node & acts on
* the results obtained from bucket nodes.
*
* @author ashahid
*
*/
public class AvgDistinctPRQueryNode extends SumDistinctPRQueryNode {
@Override
public Object terminate() {
double sum = ((Number) super.terminate()).doubleValue();
double result = sum / this.distinct.size();
return downCast(result);
}
}