code: private void validateNoAggs(AggFinder aggFinder, SqlNode node,
  		String clause) {
  		final SqlCall agg = aggFinder.findAgg(node);
  		if (agg == null) {
  			return;
  		}
  		final SqlOperator op = agg.getOperator();
  		if (op == SqlStdOperatorTable.OVER) {
  			throw newValidationError(agg,
  				RESOURCE.windowedAggregateIllegalInClause(clause));
  		} else if (op.isGroup() || op.isGroupAuxiliary()) {
  			throw newValidationError(agg,
  				RESOURCE.groupFunctionMustAppearInGroupByClause(op.getName()));
  		} else {
  			throw newValidationError(agg,
  				RESOURCE.aggregateIllegalInClause(clause));
  		}
  	}
docs: Throws an error if there is an aggregate or windowed aggregate in the
  given clause.
  
  @param aggFinder Finder for the particular kind(s) of aggregate function
  @param node      Parse tree
  @param clause    Name of clause: "WHERE", "GROUP BY", "ON"