typeFactory.createTypeWithNullability(
argType,
true);
final AggregateCall sumArgSquaredAggCall =
new AggregateCall(
new SqlSumAggFunction(sumType),
oldCall.isDistinct(),
ImmutableIntList.of(argSquaredOrdinal),
sumType,
null);
final RexNode sumArgSquared =
rexBuilder.addAggCall(
sumArgSquaredAggCall,
nGroups,
newCalls,
aggCallMapping,
ImmutableList.of(argType));
final AggregateCall sumArgAggCall =
new AggregateCall(
new SqlSumAggFunction(sumType),
oldCall.isDistinct(),
ImmutableIntList.of(argOrdinal),
sumType,
null);
final RexNode sumArg =