private final void processAggCall(AggregateCall aggCall) {
        if (isApplicable(aggCall)) {
          rewrite(aggCall);
        } else {
          appendAggCall(aggCall);
        }
      }
The new projections expressions inserted belove the aggregate

These projections could be used to prepocess the incoming datastream.
For example a CAST might need to be injected.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveRewriteToDataSketchesRules.java