public AggregateCall apply(AggregateCall call) { return call.copy(Mappings.apply2(mapping, call.getArgList()), Mappings.apply(mapping, call.filterArg)); } });
newAggrCalls.add(aggrCall.copy(newArgs.build(), newFilterArg));
aggCall = aggCall.copy(nullableArgs, aggCall.filterArg); rewrite = true;
newFilterArg = -1; aggCalls.add(aggregateCall.copy(newArgs.build(), newFilterArg));
@Deprecated // to be removed before 2.0 public AggregateCall copy(List<Integer> args, int filterArg) { // ignoring collation is error-prone return copy(args, filterArg, collation); }
@Deprecated // to be removed before 2.0 public AggregateCall copy(List<Integer> args) { // ignoring filterArg and collation is error-prone return copy(args, filterArg, collation); }
@Deprecated // to be removed before 2.0 public AggregateCall copy(List<Integer> args) { return copy(args, filterArg); }
public AggregateCall topSplit(RexBuilder rexBuilder, Registry<RexNode> extra, int offset, RelDataType inputRowType, AggregateCall aggregateCall, int leftSubTotal, int rightSubTotal, JoinRelType joinRelType) { assert (leftSubTotal >= 0) != (rightSubTotal >= 0); final int arg = leftSubTotal >= 0 ? leftSubTotal : rightSubTotal; return aggregateCall.copy(ImmutableIntList.of(arg), -1); } }
public AggregateCall topSplit(RexBuilder rexBuilder, Registry<RexNode> extra, int offset, RelDataType inputRowType, AggregateCall aggregateCall, int leftSubTotal, int rightSubTotal) { assert (leftSubTotal >= 0) != (rightSubTotal >= 0); final int arg = leftSubTotal >= 0 ? leftSubTotal : rightSubTotal; return aggregateCall.copy(ImmutableIntList.of(arg), -1); } }
public AggregateCall topSplit(RexBuilder rexBuilder, Registry<RexNode> extra, int offset, RelDataType inputRowType, AggregateCall aggregateCall, int leftSubTotal, int rightSubTotal) { assert (leftSubTotal >= 0) != (rightSubTotal >= 0); assert aggregateCall.collation.getFieldCollations().isEmpty(); final int arg = leftSubTotal >= 0 ? leftSubTotal : rightSubTotal; return aggregateCall.copy(ImmutableIntList.of(arg), -1, RelCollations.EMPTY); } }
private static List<AggregateCall> apply(final Mapping mapping, List<AggregateCall> aggCallList) { return Lists.transform(aggCallList, call -> call.copy(Mappings.apply2(mapping, call.getArgList()), Mappings.apply(mapping, call.filterArg))); }
/** Creates a copy of this aggregate call, applying a mapping to its * arguments. */ public AggregateCall transform(Mappings.TargetMapping mapping) { return copy(Mappings.apply2((Mapping) mapping, argList), hasFilter() ? Mappings.apply(mapping, filterArg) : -1); } }
/** Creates a copy of this aggregate call, applying a mapping to its * arguments. */ public AggregateCall transform(Mappings.TargetMapping mapping) { return copy(Mappings.apply2((Mapping) mapping, argList), hasFilter() ? Mappings.apply(mapping, filterArg) : -1, RelCollations.permute(collation, mapping)); } }
private AggregateCall getMergedAggCall(Aggregate secondAgg, AggregateCall aggCall) { final int grouplen = secondAgg.getGroupSet().cardinality(); final int callLen = secondAgg.getAggCallList().size(); if (aggCall.getArgList().size() == 1) { final Integer arg = aggCall.getArgList().get(0); if (arg > (grouplen - 1) && arg < (grouplen + callLen)) { AggregateCall call2 = secondAgg.getAggCallList().get(arg - grouplen); if (call2.getAggregation() == aggCall.getAggregation() && call2.getArgList().size() == 1) { return call2.copy(call2.getArgList(), call2.filterArg); } } } return null; }
final List<Integer> nullableArgs = nullableArgs(args, aggArgTypes); if (!nullableArgs.equals(args)) { aggCall = aggCall.copy(nullableArgs, aggCall.filterArg);
final List<Integer> nullableArgs = nullableArgs(args, aggArgTypes); if (!nullableArgs.equals(args)) { aggCall = aggCall.copy(nullableArgs, aggCall.filterArg, aggCall.collation);
newAggrCalls.add(aggrCall.copy(newArgs.build(), newFilterArg));
newFilterArg = -1; aggCalls.add(aggregateCall.copy(newArgs.build(), newFilterArg));
aggCall = aggCall.copy(aggCall.getArgList(), -1, aggCall.collation);
newFilterArg = -1; newCalls.add(aggCall.copy(aggCall.getArgList(), newFilterArg));