PushSemiJoinPastJoinRule.INSTANCE,
new PushSemiJoinPastFilterRule(HiveFilterRel.DEFAULT_FILTER_FACTORY),
new PushSemiJoinPastProjectRule(HiveProjectRel.DEFAULT_PROJECT_FACTORY));
basePlan = hepPlan(basePlan, true, mdProvider,
new PushFilterPastProjectRule(
FilterRelBase.class, HiveFilterRel.DEFAULT_FILTER_FACTORY, HiveProjectRel.class,
HiveProjectRel.DEFAULT_PROJECT_FACTORY), new PushFilterPastSetOpRule(
HiveFilterRel.DEFAULT_FILTER_FACTORY), new MergeFilterRule(
HiveFilterRel.DEFAULT_FILTER_FACTORY), HivePushFilterPastJoinRule.JOIN,
HivePushFilterPastJoinRule.FILTER_ON_JOIN,
new FilterAggregateTransposeRule(
FilterRelBase.class,
HiveFilterRel.DEFAULT_FILTER_FACTORY,
AggregateRelBase.class));
basePlan = hepPlan(basePlan, false, mdProvider, new TransitivePredicatesOnJoinRule(
JoinRelBase.class, HiveFilterRel.DEFAULT_FILTER_FACTORY),
// TODO: Enable it after OPTIQ-407 is fixed
//RemoveTrivialProjectRule.INSTANCE,
new HivePartitionPrunerRule(SemanticAnalyzer.this.conf));
RelFieldTrimmer fieldTrimmer = new RelFieldTrimmer(null, HiveProjectRel.DEFAULT_PROJECT_FACTORY,
HiveFilterRel.DEFAULT_FILTER_FACTORY, HiveJoinRel.HIVE_JOIN_FACTORY, RelFactories.DEFAULT_SEMI_JOIN_FACTORY,
HiveSortRel.HIVE_SORT_REL_FACTORY, HiveAggregateRel.HIVE_AGGR_REL_FACTORY, HiveUnionRel.UNION_REL_FACTORY);
basePlan = fieldTrimmer.trim(basePlan);
basePlan = hepPlan(basePlan, true, mdProvider,
new PushFilterPastProjectRule(FilterRelBase.class,
HiveFilterRel.DEFAULT_FILTER_FACTORY, HiveProjectRel.class,
HiveProjectRel.DEFAULT_PROJECT_FACTORY));
return basePlan;
}