private void groupDistinct(Database database, int dataType) { if (distinctValues == null) { return; } count = 0; for (Value v : distinctValues.keys()) { add(database, dataType, false, v); } }
if (distinct) { count = 0; groupDistinct(database, dataType); case Aggregate.AVG: if (value != null) { v = divide(value, count);
/** * Create an AggregateData object of the correct sub-type. * * @param aggregateType the type of the aggregate operation * @return the aggregate data object of the specified type */ static AggregateData create(int aggregateType) { if (aggregateType == Aggregate.SELECTIVITY) { return new AggregateDataSelectivity(); } else if (aggregateType == Aggregate.GROUP_CONCAT) { return new AggregateDataGroupConcat(); } else if (aggregateType == Aggregate.COUNT_ALL) { return new AggregateDataCountAll(); } else if (aggregateType == Aggregate.COUNT) { return new AggregateDataCount(); } else if (aggregateType == Aggregate.HISTOGRAM) { return new AggregateDataHistogram(); } else { return new AggregateDataDefault(aggregateType); } }