oldAggRel.getChild(),
arg);
RelDataType sumType =
typeFactory.createTypeWithNullability(
argType, argType.isNullable());
SqlAggFunction sumZeroAgg = new SqlSumEmptyIsZeroAggFunction(sumType);
AggregateCall sumZeroCall =
new AggregateCall(
sumZeroAgg,
oldCall.isDistinct(),
oldCall.getArgList(),
sumType,
null);
SqlAggFunction countAgg = SqlStdOperatorTable.COUNT;
RelDataType countType = countAgg.getReturnType(typeFactory);
AggregateCall countCall =
new AggregateCall(
countAgg,
oldCall.isDistinct(),
oldCall.getArgList(),