public boolean hasAggregations() {
    return !groupBy().isEmpty() || projections().stream().anyMatch(Visitors::isAggregationCall);
  }
Check if current query has any aggregation calls
criteria/common/src/org/immutables/criteria/expression/Query.java