LogicalAggregate.create(newProject, false, newGroupSet,
ImmutableBitSet.range(groupCount); LogicalAggregate newAggregate = LogicalAggregate.create(joinOutputProject, false, groupSet,
case AGGREGATE: final MutableAggregate aggregate = (MutableAggregate) node; return LogicalAggregate.create(fromMutable(aggregate.input), aggregate.indicator, aggregate.groupSet, aggregate.groupSets, aggregate.aggCalls);
@SuppressWarnings("deprecation") public RelNode createAggregate(RelNode input, boolean indicator, ImmutableBitSet groupSet, ImmutableList<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) { return LogicalAggregate.create(input, indicator, groupSet, groupSets, aggCalls); } }
@SuppressWarnings("deprecation") public RelNode createAggregate(RelNode input, boolean indicator, ImmutableBitSet groupSet, ImmutableList<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) { return LogicalAggregate.create(input, indicator, groupSet, groupSets, aggCalls); } }
/** * Creates an Aggregate. * * <p>In case the aggregate rel changes the order in which it projects * fields, the <code>groupExprProjection</code> parameter is provided, and * the implementation of this method may modify it. * * <p>The <code>sortedCount</code> parameter is the number of expressions * known to be monotonic. These expressions must be on the leading edge of * the grouping keys. The default implementation of this method ignores this * parameter. * * @param bb Blackboard * @param groupSet Bit set of ordinals of grouping columns * @param groupSets Grouping sets * @param aggCalls Array of calls to aggregate functions * @return LogicalAggregate */ protected RelNode createAggregate(Blackboard bb, ImmutableBitSet groupSet, ImmutableList<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) { return LogicalAggregate.create(bb.root, groupSet, groupSets, aggCalls); }
/** * Creates an Aggregate. * * <p>In case the aggregate rel changes the order in which it projects * fields, the <code>groupExprProjection</code> parameter is provided, and * the implementation of this method may modify it. * * <p>The <code>sortedCount</code> parameter is the number of expressions * known to be monotonic. These expressions must be on the leading edge of * the grouping keys. The default implementation of this method ignores this * parameter. * * @param bb Blackboard * @param groupSet Bit set of ordinals of grouping columns * @param groupSets Grouping sets * @param aggCalls Array of calls to aggregate functions * @return LogicalAggregate */ protected RelNode createAggregate(Blackboard bb, ImmutableBitSet groupSet, ImmutableList<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) { return LogicalAggregate.create(bb.root, groupSet, groupSets, aggCalls); }
/** * Creates an Aggregate. * * <p>In case the aggregate rel changes the order in which it projects * fields, the <code>groupExprProjection</code> parameter is provided, and * the implementation of this method may modify it. * * <p>The <code>sortedCount</code> parameter is the number of expressions * known to be monotonic. These expressions must be on the leading edge of * the grouping keys. The default implementation of this method ignores this * parameter. * * @param bb Blackboard * @param indicator Whether to output fields indicating grouping sets * @param groupSet Bit set of ordinals of grouping columns * @param groupSets Grouping sets * @param aggCalls Array of calls to aggregate functions * @return LogicalAggregate */ protected RelNode createAggregate(Blackboard bb, boolean indicator, ImmutableBitSet groupSet, ImmutableList<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) { return LogicalAggregate.create( bb.root, indicator, groupSet, groupSets, aggCalls); }
/** * Creates an Aggregate. * * <p>In case the aggregate rel changes the order in which it projects * fields, the <code>groupExprProjection</code> parameter is provided, and * the implementation of this method may modify it. * * <p>The <code>sortedCount</code> parameter is the number of expressions * known to be monotonic. These expressions must be on the leading edge of * the grouping keys. The default implementation of this method ignores this * parameter. * * @param bb Blackboard * @param indicator Whether to output fields indicating grouping sets * @param groupSet Bit set of ordinals of grouping columns * @param groupSets Grouping sets * @param aggCalls Array of calls to aggregate functions * @return LogicalAggregate */ protected RelNode createAggregate(Blackboard bb, boolean indicator, ImmutableBitSet groupSet, ImmutableList<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) { return LogicalAggregate.create( bb.root, indicator, groupSet, groupSets, aggCalls); }
/** @deprecated Use {@link RelBuilder#distinct()}. */ @Deprecated // to be removed before 2.0 public static RelNode createDistinctRel(RelNode rel) { return LogicalAggregate.create(rel, ImmutableBitSet.range(rel.getRowType().getFieldCount()), null, ImmutableList.of()); }
/** @deprecated Use {@link RelBuilder#distinct()}. */ @Deprecated // to be removed before 2.0 public static RelNode createDistinctRel(RelNode rel) { return LogicalAggregate.create(rel, ImmutableBitSet.range(rel.getRowType().getFieldCount()), null, ImmutableList.of()); }
/** * Creates a LogicalAggregate that removes all duplicates from the result of * an underlying relational expression. * * @param rel underlying rel * @return rel implementing SingleValueAgg */ public static RelNode createSingleValueAggRel( RelOptCluster cluster, RelNode rel) { // assert (rel.getRowType().getFieldCount() == 1); final int aggCallCnt = rel.getRowType().getFieldCount(); final List<AggregateCall> aggCalls = new ArrayList<>(); for (int i = 0; i < aggCallCnt; i++) { aggCalls.add( AggregateCall.create( SqlStdOperatorTable.SINGLE_VALUE, false, false, ImmutableList.of(i), -1, 0, rel, null, null)); } return LogicalAggregate.create(rel, ImmutableBitSet.of(), null, aggCalls); }
/** * Creates a LogicalAggregate that removes all duplicates from the result of * an underlying relational expression. * * @param rel underlying rel * @return rel implementing SingleValueAgg */ public static RelNode createSingleValueAggRel( RelOptCluster cluster, RelNode rel) { final int aggCallCnt = rel.getRowType().getFieldCount(); final List<AggregateCall> aggCalls = new ArrayList<>(); for (int i = 0; i < aggCallCnt; i++) { aggCalls.add( AggregateCall.create(SqlStdOperatorTable.SINGLE_VALUE, false, false, ImmutableList.of(i), -1, RelCollations.EMPTY, 0, rel, null, null)); } return LogicalAggregate.create(rel, ImmutableBitSet.of(), null, aggCalls); }
if (!outerJoin) { final LogicalAggregate aggregate = LogicalAggregate.create(ret, ImmutableBitSet.range(keyCount), null, ImmutableList.of()); return new Exists(aggregate, false, false); null); ret = LogicalAggregate.create(ret, ImmutableBitSet.range(projectedKeyCount), null, ImmutableList.of(aggCall));
LogicalAggregate.create(ret, ImmutableBitSet.of(), null, ImmutableList.of(aggCall));
LogicalAggregate.create(ret, ImmutableBitSet.of(), null, ImmutableList.of(aggCall));
@Override public void onMatch(RelOptRuleCall call) { final Delta delta = call.rel(0); Util.discard(delta); final Aggregate aggregate = call.rel(1); final LogicalDelta newDelta = LogicalDelta.create(aggregate.getInput()); final LogicalAggregate newAggregate = LogicalAggregate.create(newDelta, aggregate.getGroupSet(), aggregate.groupSets, aggregate.getAggCallList()); call.transformTo(newAggregate); } }
@Override public void onMatch(RelOptRuleCall call) { final Delta delta = call.rel(0); Util.discard(delta); final Aggregate aggregate = call.rel(1); final LogicalDelta newDelta = LogicalDelta.create(aggregate.getInput()); final LogicalAggregate newAggregate = LogicalAggregate.create(newDelta, aggregate.getGroupSet(), aggregate.groupSets, aggregate.getAggCallList()); call.transformTo(newAggregate); } }
cluster.getTypeFactory().createSqlType(SqlTypeName.BIGINT); LogicalAggregate aggregate = LogicalAggregate.create(filter, ImmutableBitSet.of(0), null, ImmutableList.of( AggregateCall.create(SqlStdOperatorTable.COUNT,
cluster.getTypeFactory().createSqlType(SqlTypeName.BIGINT); LogicalAggregate aggregate = LogicalAggregate.create(filter, ImmutableBitSet.of(0), null, ImmutableList.of( AggregateCall.create(SqlStdOperatorTable.COUNT,