private void groupDistinct(Database database, int dataType) { if (distinctValues == null) { return; } for (Value v : distinctValues.keys()) { add(database, dataType, false, v); } } }
@Override Value getValue(Database database, int dataType, boolean distinct) { if (distinct) { groupDistinct(database, dataType); } return null; }
/** * 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); } }
ArrayList<Value> list = ((AggregateDataGroupConcat) data).getList(); if (list == null || list.size() == 0) { return ValueNull.INSTANCE;