@Nullable public SqlAggregator lookupAggregator(final SqlAggFunction aggFunction) { final SqlAggregator sqlAggregator = aggregators.get(OperatorKey.of(aggFunction)); if (sqlAggregator != null && sqlAggregator.calciteFunction().equals(aggFunction)) { return sqlAggregator; } else { return null; } }
@Override public boolean matches(RelOptRuleCall call) { final Aggregate aggregate = call.rel(0); // Rule cannot be applied if there are GroupingId because it will change the // value as the position will be changed. for (AggregateCall aggCall : aggregate.getAggCallList()) { if (aggCall.getAggregation().equals(HiveGroupingID.INSTANCE)) { return false; } } return super.matches(call); }
@Override public boolean matches(RelOptRuleCall call) { final Aggregate aggregate = call.rel(0); // Rule cannot be applied if there are GroupingId because it will change the // value as the position will be changed. for (AggregateCall aggCall : aggregate.getAggCallList()) { if (aggCall.getAggregation().equals(HiveGroupingID.INSTANCE)) { return false; } } return super.matches(call); }
@Override public boolean equals(Object obj) { return obj == this || obj instanceof Measure && this.agg.equals(((Measure) obj).agg) && this.args.equals(((Measure) obj).args) && this.distinct == ((Measure) obj).distinct; }
@Override public boolean equals(Object obj) { return obj == this || obj instanceof Measure && this.agg.equals(((Measure) obj).agg) && this.args.equals(((Measure) obj).args); }
@Override public boolean equals(Object o) { if (!(o instanceof AggregateCall)) { return false; } AggregateCall other = (AggregateCall) o; return aggFunction.equals(other.aggFunction) && (distinct == other.distinct) && argList.equals(other.argList) && filterArg == other.filterArg; }
@Override public boolean equals(Object o) { if (!(o instanceof AggregateCall)) { return false; } AggregateCall other = (AggregateCall) o; return aggFunction.equals(other.aggFunction) && (distinct == other.distinct) && argList.equals(other.argList) && filterArg == other.filterArg && Objects.equals(collation, other.collation); }
private static int find(ImmutableList<Lattice.Measure> measures, Pair<SqlAggFunction, List<Integer>> seek) { for (int i = 0; i < measures.size(); i++) { Lattice.Measure measure = measures.get(i); if (measure.agg.equals(seek.left) && measure.argOrdinals().equals(seek.right)) { return i; } } return -1; } }
private static int find(ImmutableList<Lattice.Measure> measures, Pair<SqlAggFunction, List<Integer>> seek) { for (int i = 0; i < measures.size(); i++) { Lattice.Measure measure = measures.get(i); if (measure.agg.equals(seek.left) && measure.argOrdinals().equals(seek.right)) { return i; } } return -1; } }
public SqlAggregator lookupAggregator(final SqlAggFunction aggFunction) { final SqlAggregator sqlAggregator = aggregators.get(OperatorKey.of(aggFunction)); if (sqlAggregator != null && sqlAggregator.calciteFunction().equals(aggFunction)) { return sqlAggregator; } else { return null; } }