Package org.eigenbase.rel

Examples of org.eigenbase.rel.AggregateRelBase


  @Override
  public void onMatch(RelOptRuleCall call) {
    final ProjectRelBase project = call.rel(0);
    final JoinRelBase join = call.rel(1);
    final RelNode left = call.rel(2);
    final AggregateRelBase aggregate = call.rel(3);
    final BitSet bits = RelOptUtil.InputFinder.bits(project.getProjects(),
        null);
    final BitSet rightBits = BitSets.range(left.getRowType().getFieldCount(),
        join.getRowType().getFieldCount());
    if (bits.intersects(rightBits)) {
      return;
    }
    final JoinInfo joinInfo = join.analyzeCondition();
    if (!joinInfo.rightSet().equals(BitSets.range(aggregate.getGroupCount()))) {
      // Rule requires that aggregate key to be the same as the join key.
      // By the way, neither a super-set nor a sub-set would work.
      return;
    }
    final List<Integer> newRightKeys = Lists.newArrayList();
    final IntList aggregateKeys = BitSets.toList(aggregate.getGroupSet());
    for (int key : joinInfo.rightKeys) {
      newRightKeys.add(aggregateKeys.get(key));
    }
    final SemiJoinRel semiJoin =
        new SemiJoinRel(join.getCluster(),
            join.getCluster().traitSetOf(Convention.NONE),
            left, aggregate.getChild(),
            join.getCondition(), joinInfo.leftKeys,
            ImmutableIntList.copyOf(newRightKeys));
    final ProjectRelBase newProject =
        project.copy(project.getTraitSet(), semiJoin, project.getProjects(),
            project.getRowType());
View Full Code Here


  @Override
  public boolean matches(RelOptRuleCall call) {
    if (!super.matches(call)) {
      return false;
    }
    AggregateRelBase oldAggRel = (AggregateRelBase) call.rels[0];
    return containsAvgStddevVarCall(oldAggRel.getAggCallList());
  }
View Full Code Here

    AggregateRelBase oldAggRel = (AggregateRelBase) call.rels[0];
    return containsAvgStddevVarCall(oldAggRel.getAggCallList());
  }

  public void onMatch(RelOptRuleCall ruleCall) {
    AggregateRelBase oldAggRel = (AggregateRelBase) ruleCall.rels[0];
    reduceAggs(ruleCall, oldAggRel);
  }
View Full Code Here

                  input.getRowType().getFieldNames(),
                  Collections.<String>nCopies(
                      extraArgCount,
                      null)));
    }
    AggregateRelBase newAggRel =
        newAggregateRel(
            oldAggRel, input, newCalls);

    RelNode projectRel =
        CalcRel.createProject(
View Full Code Here

TOP

Related Classes of org.eigenbase.rel.AggregateRelBase

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.