Package org.eigenbase.relopt.hep

Examples of org.eigenbase.relopt.hep.HepProgram


   * Converts a relational expression to a form where
   * {@link org.eigenbase.rel.JoinRel}s are
   * as close to leaves as possible.
   */
  public static RelNode toLeafJoinForm(RelNode rel) {
    HepProgram program = HepProgram.builder()
        .addRuleInstance(PullUpProjectsAboveJoinRule.RIGHT_PROJECT)
        .addRuleInstance(PullUpProjectsAboveJoinRule.LEFT_PROJECT)
        .build();
    final HepPlanner planner =
        new HepPlanner(program);
View Full Code Here


  @Test public void testStrengthenJoinType() {
    // The "Filter(... , right.c IS NOT NULL)" above a left join is pushed into
    // the join, makes it an inner join, and then disappears because c is NOT
    // NULL.
    final HepProgram preProgram =
        HepProgram.builder()
            .addRuleInstance(MergeProjectRule.INSTANCE)
            .addRuleInstance(PushFilterPastProjectRule.INSTANCE)
            .build();
    final HepProgram program =
        HepProgram.builder()
            .addRuleInstance(PushFilterPastJoinRule.FILTER_ON_JOIN)
            .build();
    checkPlanning(tester.withDecorrelation(true).withTrim(true), preProgram,
        new HepPlanner(program),
View Full Code Here

        + " on d.deptno = e.deptno"
        + " where d.name = 'Charlie'");
  }

  @Test public void testSemiJoinRule() {
    final HepProgram preProgram =
        HepProgram.builder()
            .addRuleInstance(PushFilterPastProjectRule.INSTANCE)
            .addRuleInstance(PushFilterPastJoinRule.FILTER_ON_JOIN)
            .addRuleInstance(MergeProjectRule.INSTANCE)
            .build();
    final HepProgram program =
        HepProgram.builder()
            .addRuleInstance(SemiJoinRule.INSTANCE)
            .build();
    checkPlanning(tester.withDecorrelation(true).withTrim(true), preProgram,
        new HepPlanner(program),
View Full Code Here

        + "(select * from emp e1 union all select * from emp e2) r2");
  }

  @Ignore("cycles")
  @Test public void testMergeFilterWithJoinCondition() throws Exception {
    HepProgram program = new HepProgramBuilder()
        .addRuleInstance(TableAccessRule.INSTANCE)
        .addRuleInstance(ExtractJoinFilterRule.INSTANCE)
        .addRuleInstance(FilterToCalcRule.INSTANCE)
        .addRuleInstance(MergeCalcRule.INSTANCE)
            //.addRuleInstance(FennelCalcRule.instance);
View Full Code Here

    // of the projections, we force a Fennel implementation.
    // For the other, we force a Java implementation.
    // Then, we request conversion from Fennel to Java,
    // and verify that it only applies to one usage of the
    // table, not both (which would be incorrect).
    HepProgram program = new HepProgramBuilder()
        .addRuleInstance(TableAccessRule.INSTANCE)
        .addRuleInstance(ProjectToCalcRule.INSTANCE)

            // Control the calc conversion.
        .addMatchLimit(1)
View Full Code Here

        + " select lower(ename) from emp");
  }

  @Test public void testPushSemiJoinPastJoinRuleLeft() throws Exception {
    // tests the case where the semijoin is pushed to the left
    HepProgram program = new HepProgramBuilder()
        .addRuleInstance(PushFilterPastJoinRule.FILTER_ON_JOIN)
        .addRuleInstance(AddRedundantSemiJoinRule.INSTANCE)
        .addRuleInstance(PushSemiJoinPastJoinRule.INSTANCE)
        .build();
    checkPlanning(program,
View Full Code Here

        + "where e1.deptno = d.deptno and e1.empno = e2.empno");
  }

  @Test public void testPushSemiJoinPastJoinRuleRight() throws Exception {
    // tests the case where the semijoin is pushed to the right
    HepProgram program = new HepProgramBuilder()
        .addRuleInstance(PushFilterPastJoinRule.FILTER_ON_JOIN)
        .addRuleInstance(AddRedundantSemiJoinRule.INSTANCE)
        .addRuleInstance(PushSemiJoinPastJoinRule.INSTANCE)
        .build();
    checkPlanning(program,
View Full Code Here

        "select e1.ename from emp e1, dept d, emp e2 "
        + "where e1.deptno = d.deptno and d.deptno = e2.deptno");
  }

  @Test public void testPushSemiJoinPastFilter() throws Exception {
    HepProgram program = new HepProgramBuilder()
        .addRuleInstance(PushFilterPastJoinRule.FILTER_ON_JOIN)
        .addRuleInstance(AddRedundantSemiJoinRule.INSTANCE)
        .addRuleInstance(PushSemiJoinPastFilterRule.INSTANCE)
        .build();
    checkPlanning(program,
View Full Code Here

        "select e.ename from emp e, dept d "
        + "where e.deptno = d.deptno and e.ename = 'foo'");
  }

  @Test public void testConvertMultiJoinRule() throws Exception {
    HepProgram program = new HepProgramBuilder()
        .addRuleInstance(PushFilterPastJoinRule.FILTER_ON_JOIN)
        .addMatchOrder(HepMatchOrder.BOTTOM_UP)
        .addRuleInstance(ConvertMultiJoinRule.INSTANCE)
        .build();
    checkPlanning(program,
View Full Code Here

        "select e1.ename from emp e1, dept d, emp e2 "
        + "where e1.deptno = d.deptno and d.deptno = e2.deptno");
  }

  @Test public void testReduceConstants() throws Exception {
    HepProgram program = new HepProgramBuilder()
        .addRuleInstance(ReduceExpressionsRule.PROJECT_INSTANCE)
        .addRuleInstance(ReduceExpressionsRule.FILTER_INSTANCE)
        .addRuleInstance(ReduceExpressionsRule.JOIN_INSTANCE)
        .build();
View Full Code Here

TOP

Related Classes of org.eigenbase.relopt.hep.HepProgram

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.