/** * 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); } }