hql.g:643:1: aggregateDistinctAll : ( ( DISTINCT | ALL )? ( path | collectionExpr ) ) ;
16706
public final hqlParser.aggregateDistinctAll_return aggregateDistinctAll() throws RecognitionException {
		hqlParser.aggregateDistinctAll_return retval = new hqlParser.aggregateDistinctAll_return();
		retval.start = input.LT(1);

		CommonTree root_0 = null;

		Token set271=null;
		ParserRuleReturnScope path272 =null;
		ParserRuleReturnScope collectionExpr273 =null;

		CommonTree set271_tree=null;

		try {
			// hql.g:644:2: ( ( ( DISTINCT | ALL )? ( path | collectionExpr ) ) )
			// hql.g:644:4: ( ( DISTINCT | ALL )? ( path | collectionExpr ) )
			{
			root_0 = (CommonTree)adaptor.nil();


			// hql.g:644:4: ( ( DISTINCT | ALL )? ( path | collectionExpr ) )
			// hql.g:644:6: ( DISTINCT | ALL )? ( path | collectionExpr )
			{
			// hql.g:644:6: ( DISTINCT | ALL )?
			int alt97=2;
			int LA97_0 = input.LA(1);
			if ( (LA97_0==ALL||LA97_0==DISTINCT) ) {
				alt97=1;
			}
			switch (alt97) {
				case 1 :
					// hql.g:
					{
					set271=input.LT(1);
					if ( input.LA(1)==ALL||input.LA(1)==DISTINCT ) {
						input.consume();
						adaptor.addChild(root_0, adaptor.create(set271));
						state.errorRecovery=false;
					}
					else {
						MismatchedSetException mse = new MismatchedSetException(null,input);
						throw mse;
					}
					}
					break;

			}

			// hql.g:644:26: ( path | collectionExpr )
			int alt98=2;
			int LA98_0 = input.LA(1);
			if ( (LA98_0==IDENT) ) {
				alt98=1;
			}
			else if ( (LA98_0==ELEMENTS||LA98_0==INDICES) ) {
				alt98=2;
			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 98, 0, input);
				throw nvae;
			}

			switch (alt98) {
				case 1 :
					// hql.g:644:28: path
					{
					pushFollow(FOLLOW_path_in_aggregateDistinctAll3230);
					path272=path();
					state._fsp--;

					adaptor.addChild(root_0, path272.getTree());

					}
					break;
				case 2 :
					// hql.g:644:35: collectionExpr
					{
					pushFollow(FOLLOW_collectionExpr_in_aggregateDistinctAll3234);
					collectionExpr273=collectionExpr();
					state._fsp--;

					adaptor.addChild(root_0, collectionExpr273.getTree());

					}
					break;

			}

			}

			}

			retval.stop = input.LT(-1);

			retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
690356
@Override
    public void _distinct() {
        if (isDistinct()) {
            throw new IllegalStateException("The is already a distinct query");
        }

        if (selectTokens.isEmpty()) {
            selectTokens.add(DistinctToken.INSTANCE);
        } else {
            selectTokens.add(0, DistinctToken.INSTANCE);
        }
    }
8251
public boolean duplicatesInStack(LinkedList<SchemaTableTree> distinctQueryStack) {
        Set<SchemaTable> alreadyVisited = new HashSet<>();
        for (SchemaTableTree schemaTableTree : distinctQueryStack) {
            if (!alreadyVisited.contains(schemaTableTree.getSchemaTable())) {
                alreadyVisited.add(schemaTableTree.getSchemaTable());
            } else {
                return true;
            }
        }
        return false;
    }
1337780
public int getAggregationDistinctColumnIndex(final String distinctColumnLabel) {
        for (Entry<Integer, String> entry : aggregationDistinctColumnIndexAndLabels.entrySet()) {
            if (entry.getValue().equals(distinctColumnLabel)) {
                return entry.getKey();
            }
        }
        throw new ShardingException("Can not get aggregation distinct column index.");
    }
138256
public static function countDistinct(string $column, string $as = null, string $tableAlias = null): self
    {
        return (new self(Aggregation\Type::COUNT, $column, $as, $tableAlias))->distinct();
    }
89486
public void onMatch(RelOptRuleCall call) {
		final Aggregate aggregate = call.rel(0);
		if (!AggregateUtil.containsAccurateDistinctCall(aggregate.getAggCallList())) {
			return;
		}
		// Check unsupported aggregate which contains both approximate distinct call and
		// accurate distinct call.
		if (AggregateUtil.containsApproximateDistinctCall(aggregate.getAggCallList())) {
			throw new TableException(
					"There are both Distinct AggCall and Approximate Distinct AggCall in one sql statement, " +
							"it is not supported yet.\nPlease choose one of them.");
		}

		// If this aggregate is a non-simple aggregate(e.g. CUBE, ROLLUP)
		// and contains distinct calls, it should be transformed to simple aggregate first
		// by DecomposeGroupingSetsRule. Then this rule expands it's distinct aggregates.
		if (aggregate.getGroupSets().size() > 1) {
			return;
		}

		// Find all of the agg expressions. We use a LinkedHashSet to ensure determinism.
		int nonDistinctAggCallCount = 0;  // find all aggregate calls without distinct
		int filterCount = 0;
		int unsupportedNonDistinctAggCallCount = 0;
		final Set<Pair<List<Integer>, Integer>> argLists = new LinkedHashSet<>();
		for (AggregateCall aggCall : aggregate.getAggCallList()) {
			if (aggCall.filterArg >= 0) {
				++filterCount;
			}
			if (!aggCall.isDistinct()) {
				++nonDistinctAggCallCount;
				final SqlKind aggCallKind = aggCall.getAggregation().getKind();
				// We only support COUNT/SUM/MIN/MAX for the "single" count distinct optimization
				switch (aggCallKind) {
					case COUNT:
					case SUM:
					case SUM0:
					case MIN:
					case MAX:
						break;
					default:
						++unsupportedNonDistinctAggCallCount;
				}
			} else {
				argLists.add(Pair.of(aggCall.getArgList(), aggCall.filterArg));
			}
		}

		final int distinctAggCallCount =
				aggregate.getAggCallList().size() - nonDistinctAggCallCount;
		Preconditions.checkState(argLists.size() > 0, "containsDistinctCall lied");

		// If all of the agg expressions are distinct and have the same
		// arguments then we can use a more efficient form.
		if (nonDistinctAggCallCount == 0
				&& argLists.size() == 1
				&& aggregate.getGroupType() == Group.SIMPLE) {
			final Pair<List<Integer>, Integer> pair =
					com.google.common.collect.Iterables.getOnlyElement(argLists);
			final RelBuilder relBuilder = call.builder();
			convertMonopole(relBuilder, aggregate, pair.left, pair.right);
			call.transformTo(relBuilder.build());
			return;
		}

		if (useGroupingSets) {
			rewriteUsingGroupingSets(call, aggregate);
			return;
		}

		// If only one distinct aggregate and one or more non-distinct aggregates,
		// we can generate multi-phase aggregates
		if (distinctAggCallCount == 1 // one distinct aggregate
				&& filterCount == 0 // no filter
				&& unsupportedNonDistinctAggCallCount == 0 // sum/min/max/count in non-distinct aggregate
				&& nonDistinctAggCallCount > 0) { // one or more non-distinct aggregates
			final RelBuilder relBuilder = call.builder();
			convertSingletonDistinct(relBuilder, aggregate, argLists);
			call.transformTo(relBuilder.build());
			return;
		}

		// Create a list of the expressions which will yield the final result.
		// Initially, the expressions point to the input field.
		final List<RelDataTypeField> aggFields =
				aggregate.getRowType().getFieldList();
		final List<RexInputRef> refs = new ArrayList<>();
		final List<String> fieldNames = aggregate.getRowType().getFieldNames();
		final ImmutableBitSet groupSet = aggregate.getGroupSet();
		final int groupAndIndicatorCount =
				aggregate.getGroupCount() + aggregate.getIndicatorCount();
		for (int i : Util.range(groupAndIndicatorCount)) {
			refs.add(RexInputRef.of(i, aggFields));
		}

		// Aggregate the original relation, including any non-distinct aggregates.
		final List<AggregateCall> newAggCallList = new ArrayList<>();
		int i = -1;
		for (AggregateCall aggCall : aggregate.getAggCallList()) {
			++i;
			if (aggCall.isDistinct()) {
				refs.add(null);
				continue;
			}
			refs.add(
					new RexInputRef(
							groupAndIndicatorCount + newAggCallList.size(),
							aggFields.get(groupAndIndicatorCount + i).getType()));
			newAggCallList.add(aggCall);
		}

		// In the case where there are no non-distinct aggregates (regardless of
		// whether there are group bys), there's no need to generate the
		// extra aggregate and join.
		final RelBuilder relBuilder = call.builder();
		relBuilder.push(aggregate.getInput());
		int n = 0;
		if (!newAggCallList.isEmpty()) {
			final RelBuilder.GroupKey groupKey =
					relBuilder.groupKey(groupSet, aggregate.getGroupSets());
			relBuilder.aggregate(groupKey, newAggCallList);
			++n;
		}

		// For each set of operands, find and rewrite all calls which have that
		// set of operands.
		for (Pair<List<Integer>, Integer> argList : argLists) {
			doRewrite(relBuilder, aggregate, n++, argList.left, argList.right, refs);
		}

		relBuilder.project(refs, fieldNames);
		call.transformTo(relBuilder.build());
	}
377423
public static JPQLQuery<Tuple> selectDistinct(Expression<?>... exprs) {
        return new JPASubQuery<Void>().select(exprs).distinct();
    }
925550
public final hqlParser.inCollectionDeclaration_return inCollectionDeclaration() throws RecognitionException {
		hqlParser.inCollectionDeclaration_return retval = new hqlParser.inCollectionDeclaration_return();
		retval.start = input.LT(1);

		CommonTree root_0 = null;

		Token IN99=null;
		Token OPEN100=null;
		Token CLOSE102=null;
		ParserRuleReturnScope path101 =null;
		ParserRuleReturnScope alias103 =null;

		CommonTree IN99_tree=null;
		CommonTree OPEN100_tree=null;
		CommonTree CLOSE102_tree=null;
		RewriteRuleTokenStream stream_OPEN=new RewriteRuleTokenStream(adaptor,"token OPEN");
		RewriteRuleTokenStream stream_IN=new RewriteRuleTokenStream(adaptor,"token IN");
		RewriteRuleTokenStream stream_CLOSE=new RewriteRuleTokenStream(adaptor,"token CLOSE");
		RewriteRuleSubtreeStream stream_alias=new RewriteRuleSubtreeStream(adaptor,"rule alias");
		RewriteRuleSubtreeStream stream_path=new RewriteRuleSubtreeStream(adaptor,"rule path");

		try {
			// hql.g:306:5: ( IN OPEN path CLOSE alias -> ^( JOIN[\"join\"] INNER[\"inner\"] path alias ) )
			// hql.g:306:7: IN OPEN path CLOSE alias
			{
			IN99=(Token)match(input,IN,FOLLOW_IN_in_inCollectionDeclaration1404);
			stream_IN.add(IN99);

			OPEN100=(Token)match(input,OPEN,FOLLOW_OPEN_in_inCollectionDeclaration1406);
			stream_OPEN.add(OPEN100);

			pushFollow(FOLLOW_path_in_inCollectionDeclaration1408);
			path101=path();
			state._fsp--;

			stream_path.add(path101.getTree());
			CLOSE102=(Token)match(input,CLOSE,FOLLOW_CLOSE_in_inCollectionDeclaration1410);
			stream_CLOSE.add(CLOSE102);

			pushFollow(FOLLOW_alias_in_inCollectionDeclaration1412);
			alias103=alias();
			state._fsp--;

			stream_alias.add(alias103.getTree());
			// AST REWRITE
			// elements: alias, path
			// token labels:
			// rule labels: retval
			// token list labels:
			// rule list labels:
			// wildcard labels:
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (CommonTree)adaptor.nil();
			// 307:6: -> ^( JOIN[\"join\"] INNER[\"inner\"] path alias )
			{
				// hql.g:307:9: ^( JOIN[\"join\"] INNER[\"inner\"] path alias )
				{
				CommonTree root_1 = (CommonTree)adaptor.nil();
				root_1 = (CommonTree)adaptor.becomeRoot(adaptor.create(JOIN, "join"), root_1);
				adaptor.addChild(root_1, adaptor.create(INNER, "inner"));
				adaptor.addChild(root_1, stream_path.nextTree());
				adaptor.addChild(root_1, stream_alias.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
516789
AggregateIterable<BsonDocument> aggregate(
      final MongoNamespace namespace,
      final List<? extends Bson> pipeline) {
    return aggregate(namespace, pipeline, BsonDocument.class);
  }
905988
public static Class<?>[] getAggregateIdClasses(Class<? extends AggregateRoot<?>>[] aggregateRootClasses) {
        checkNotNull(aggregateRootClasses, "aggregateRootClasses should not be null");
        Class<?>[] result = new Class<?>[aggregateRootClasses.length];
        for (int i = 0; i < aggregateRootClasses.length; i++) {
            result[i] = resolveGenerics(AggregateRoot.class, aggregateRootClasses[i])[0];
        }
        return result;
    }
1004231
private FilterAggregationBuilder buildWhereAggregations(EntityMetadata entityMetadata, QueryBuilder filter)
    {
        filter = filter != null ? filter : QueryBuilders.matchAllQuery();
        FilterAggregationBuilder filteragg = AggregationBuilders.filter(ESConstants.AGGREGATION_NAME).filter(filter);

        return filteragg;
    }
620878
private ImmutableMultimap<RelationDefinition, ExtensionalDataNode> extractDataNodeMap(IntermediateQuery query,
                                                                                          InnerJoinNode joinNode) {
        return query.getChildren(joinNode).stream()
                .filter(c -> c instanceof ExtensionalDataNode)
                .map(c -> (ExtensionalDataNode) c)
                .map(c -> Maps.immutableEntry(c.getProjectionAtom().getPredicate().getRelationDefinition(), c))
                .collect(ImmutableCollectors.toMultimap());
    }
786626
public final hqlParser.selectClause_return selectClause() throws RecognitionException {
		hqlParser.selectClause_return retval = new hqlParser.selectClause_return();
		retval.start = input.LT(1);

		CommonTree root_0 = null;

		Token SELECT45=null;
		Token DISTINCT46=null;
		ParserRuleReturnScope selectedPropertiesList47 =null;
		ParserRuleReturnScope newExpression48 =null;
		ParserRuleReturnScope selectObject49 =null;

		CommonTree SELECT45_tree=null;
		CommonTree DISTINCT46_tree=null;

		try {
			// hql.g:257:2: ( SELECT ^ ( DISTINCT )? ( selectedPropertiesList | newExpression | selectObject ) )
			// hql.g:257:4: SELECT ^ ( DISTINCT )? ( selectedPropertiesList | newExpression | selectObject )
			{
			root_0 = (CommonTree)adaptor.nil();


			SELECT45=(Token)match(input,SELECT,FOLLOW_SELECT_in_selectClause1018);
			SELECT45_tree = (CommonTree)adaptor.create(SELECT45);
			root_0 = (CommonTree)adaptor.becomeRoot(SELECT45_tree, root_0);

			 WeakKeywords();
			// hql.g:259:3: ( DISTINCT )?
			int alt17=2;
			int LA17_0 = input.LA(1);
			if ( (LA17_0==DISTINCT) ) {
				alt17=1;
			}
			switch (alt17) {
				case 1 :
					// hql.g:259:4: DISTINCT
					{
					DISTINCT46=(Token)match(input,DISTINCT,FOLLOW_DISTINCT_in_selectClause1030);
					DISTINCT46_tree = (CommonTree)adaptor.create(DISTINCT46);
					adaptor.addChild(root_0, DISTINCT46_tree);

					}
					break;

			}

			// hql.g:259:15: ( selectedPropertiesList | newExpression | selectObject )
			int alt18=3;
			switch ( input.LA(1) ) {
			case ALL:
			case ANY:
			case AVG:
			case BNOT:
			case CASE:
			case COLON:
			case COUNT:
			case ELEMENTS:
			case EMPTY:
			case EXISTS:
			case FALSE:
			case IDENT:
			case INDICES:
			case MAX:
			case MIN:
			case MINUS:
			case NOT:
			case NULL:
			case NUM_DECIMAL:
			case NUM_DOUBLE:
			case NUM_FLOAT:
			case NUM_INT:
			case NUM_LONG:
			case OPEN:
			case PARAM:
			case PLUS:
			case QUOTED_String:
			case SOME:
			case SUM:
			case TRUE:
				{
				alt18=1;
				}
				break;
			case NEW:
				{
				alt18=2;
				}
				break;
			case OBJECT:
				{
				alt18=3;
				}
				break;
			default:
				NoViableAltException nvae =
					new NoViableAltException("", 18, 0, input);
				throw nvae;
			}
			switch (alt18) {
				case 1 :
					// hql.g:259:17: selectedPropertiesList
					{
					pushFollow(FOLLOW_selectedPropertiesList_in_selectClause1036);
					selectedPropertiesList47=selectedPropertiesList();
					state._fsp--;

					adaptor.addChild(root_0, selectedPropertiesList47.getTree());

					}
					break;
				case 2 :
					// hql.g:259:42: newExpression
					{
					pushFollow(FOLLOW_newExpression_in_selectClause1040);
					newExpression48=newExpression();
					state._fsp--;

					adaptor.addChild(root_0, newExpression48.getTree());

					}
					break;
				case 3 :
					// hql.g:259:58: selectObject
					{
					pushFollow(FOLLOW_selectObject_in_selectClause1044);
					selectObject49=selectObject();
					state._fsp--;

					adaptor.addChild(root_0, selectObject49.getTree());

					}
					break;

			}

			}

			retval.stop = input.LT(-1);

			retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
543847
private AggregationBuilder buildSelectAggregations(AggregationBuilder aggregationBuilder,
            SelectStatement selectStatement, EntityMetadata entityMetadata)
    {
        Expression expression = ((SelectClause) selectStatement.getSelectClause()).getSelectExpression();

        if (expression instanceof CollectionExpression)
        {
            aggregationBuilder = appendAggregation((CollectionExpression) expression, entityMetadata,
                    aggregationBuilder);
        }
        else
        {
            if (isAggregationExpression(expression) && checkIfKeyExists(expression.toParsedText()))
                aggregationBuilder.subAggregation(getMetricsAggregation(expression, entityMetadata));
        }
        return aggregationBuilder;
    }
313090
void resolveColumnReferencesInGroupBy() {
        if (unresolvedExpressions == null || unresolvedExpressions.isEmpty()) {
            return;
        }

        /**
         * Hsql HashSet does not work properly to remove duplicates, I doubt the hash
         * function or equal function on expression work properly or something else
         * is wrong. So use list
         *
         */
        // resolve GROUP BY columns/expressions
        HsqlList newUnresolvedExpressions = new ArrayListIdentity();

        int size = unresolvedExpressions.size();
        for (int i = 0; i < size; i++) {
            Object obj = unresolvedExpressions.get(i);
            newUnresolvedExpressions.add(obj);
            if (i + 1 < size && obj == unresolvedExpressions.get(i+1)) {
                // unresolvedExpressions is a public member that can be accessed from anywhere and
                // I (xin) am 90% percent sure about the hsql adds the unresolved expression twice
                // together for our targeted GROUP BY alias case.
                // so we want to skip the repeated expression also.
                // For other unresolved expression, it may differs.
                i += 1;
            }
            if (obj instanceof ExpressionColumn == false) {
                continue;
            }
            ExpressionColumn element = (ExpressionColumn) obj;
            if (element.tableName != null) {
                // this alias does not belong to any table
                continue;
            }

            // group by alias which is thought as an column
            if (element.getType() != OpTypes.COLUMN) {
                continue;
            }

            // find the unsolved expression in the groupBy list
            int k = indexLimitVisible;
            int endGroupbyIndex = indexLimitVisible + groupByColumnCount;
            for (; k < endGroupbyIndex; k++) {
                if (element == exprColumns[k]) {
                    break;
                }
            }
            if (k == endGroupbyIndex) {
                // not found in selected list
                continue;
            }
            assert(exprColumns[k].getType() == OpTypes.COLUMN);

            ExpressionColumn exprCol = (ExpressionColumn) exprColumns[k];
            String alias = exprCol.getColumnName();
            if (alias == null) {
                // we should not handle this case (group by constants)
                continue;
            }

            // Find it in the SELECT list.  We need to look at all
            // the select list elements to see if there are more
            // than one.
            int matchcount = 0;
            for (int j = 0; j < indexLimitVisible; j++) {
                Expression selectCol = exprColumns[j];
                if (selectCol.alias == null) {
                    // columns referenced by their alias must have an alias
                    continue;
                }
                if (alias.equals(selectCol.alias.name)) {
                    matchcount += 1;
                    // This may be an alias to an aggregate
                    // column.  But we'll find that later, so
                    // don't check for it here.
                    exprColumns[k] = selectCol;
                    exprColumnList.set(k, selectCol);
                    if (matchcount == 1) {
                        newUnresolvedExpressions.remove(element);
                    }
                }
            }
            if (matchcount > 1) {
                throw new HsqlException(String.format("Group by expression \"%s\" is ambiguous", alias), "", 0);
            }
        }
        unresolvedExpressions = newUnresolvedExpressions;
    }
1060626
public static AggregatePlanNode convertToPartialAggregatePlanNode(HashAggregatePlanNode hashAggregateNode,
            List<Integer> aggrColumnIdxs) {
        final AggregatePlanNode partialAggr = setAggregatePlanNode(hashAggregateNode, new PartialAggregatePlanNode());
        partialAggr.m_partialGroupByColumns = aggrColumnIdxs;
        return partialAggr;
    }
39574
protected <T extends BasicInclude> List<T> aggregateBasicIncludes(List<T> original, AggregatorCallback<T> callback) throws IOException {
        final List<T> result = new LinkedList<T>();
        final Deque<T> currentAggregateList = new LinkedList<T>();
        for (final T originalElement : original) {
            // handle first loop iteration
            if (currentAggregateList.isEmpty()) {
                currentAggregateList.add(originalElement);
            }
            else {
                // test if 'originalElement' will aggregate with head element in currentAggregate 
                final T baseElement = currentAggregateList.getFirst();
                if (callback.willAggregate(originalElement, baseElement)) {
                    // matches current criteria, add to currentAggregate
                    currentAggregateList.add(originalElement);
                } 
                else {
                    // doesn't match criteria
                    // generate new single aggregate from currentAggregateList
                    final T aggregate = callback.aggregate(currentAggregateList);
                    if (null != aggregate) {
                        // push result
                        result.add(aggregate);
                    }
                    else {
                        this.logger.warn("Generated 0 byte aggregate from: " + generatePathList(currentAggregateList));
                    }

                    // zero out currentAggregateList
                    currentAggregateList.clear();

                    // add originalElement to empty list
                    currentAggregateList.add(originalElement);
                }
            }
        }
        
        // flush the currentAggregateList
        if (currentAggregateList.size() > 0) {
            final T aggregate = callback.aggregate(currentAggregateList);
            if (null != aggregate) {
                result.add(aggregate);
            }
            else {
                this.logger.warn("Generated 0 byte aggregate from: " + generatePathList(currentAggregateList));
            }
        }
        
        return result;
	}