@Override
  public boolean matches(RelOptRuleCall call) {
    final RelNode leftInput = call.rel(2);
    final RelNode rightInput = call.rel(3);

    if (leftInput instanceof Project && rightInput instanceof Project) {
      return false;
    }

    return true;
  }
Condition for expressions that should be preserved in the projection.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveProjectJoinTransposeRule.java