Throw an exception if a COUNT_QUERY is passed to be aggregation.