public boolean isAggregating() {
    return basicStatsWork != null && basicStatsWork.getAggKey() != null;
  }
Stats Work, may include basic stats work and column stats desc
ql/src/java/org/apache/hadoop/hive/ql/plan/StatsWork.java