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);