Search in sources :

Example 1 with FilterIntoJoinRule

use of org.apache.calcite.rel.rules.FilterJoinRule.FilterIntoJoinRule in project calcite by apache.

the class PigRelBuilderStyleTest method getVolcanoPlanner.

private RelOptPlanner getVolcanoPlanner(RelNode root) {
    final RelBuilderFactory builderFactory = RelBuilder.proto(PigRelFactories.ALL_PIG_REL_FACTORIES);
    // VolcanoPlanner
    final RelOptPlanner planner = root.getCluster().getPlanner();
    for (RelOptRule r : PigRules.ALL_PIG_OPT_RULES) {
        planner.addRule(r);
    }
    planner.removeRule(FilterAggregateTransposeRule.INSTANCE);
    planner.removeRule(FilterJoinRule.FILTER_ON_JOIN);
    planner.addRule(new FilterAggregateTransposeRule(PigFilter.class, builderFactory, PigAggregate.class));
    planner.addRule(new FilterIntoJoinRule(true, builderFactory, TRUE_PREDICATE));
    planner.setRoot(root);
    return planner;
}
Also used : RelBuilderFactory(org.apache.calcite.tools.RelBuilderFactory) PigAggregate(org.apache.calcite.adapter.pig.PigAggregate) FilterIntoJoinRule(org.apache.calcite.rel.rules.FilterJoinRule.FilterIntoJoinRule) FilterAggregateTransposeRule(org.apache.calcite.rel.rules.FilterAggregateTransposeRule) PigFilter(org.apache.calcite.adapter.pig.PigFilter) RelOptPlanner(org.apache.calcite.plan.RelOptPlanner) RelOptRule(org.apache.calcite.plan.RelOptRule)

Aggregations

PigAggregate (org.apache.calcite.adapter.pig.PigAggregate)1 PigFilter (org.apache.calcite.adapter.pig.PigFilter)1 RelOptPlanner (org.apache.calcite.plan.RelOptPlanner)1 RelOptRule (org.apache.calcite.plan.RelOptRule)1 FilterAggregateTransposeRule (org.apache.calcite.rel.rules.FilterAggregateTransposeRule)1 FilterIntoJoinRule (org.apache.calcite.rel.rules.FilterJoinRule.FilterIntoJoinRule)1 RelBuilderFactory (org.apache.calcite.tools.RelBuilderFactory)1