@Override
  public boolean matches(RelOptRuleCall call) {
    Filter filterRel = call.rel(0);
    RexNode condition = filterRel.getCondition();
    if (!HiveCalciteUtil.isDeterministic(condition)) {
      return false;
    }

    return super.matches(call);
  }
Creates a HiveFilterSetOpTransposeRule.
This rule rewrites
      Fil
       |
     Union
      / \
    Op1 Op2
to
      Union
        /\
        FIL
        | |
      Op1 Op2
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterSetOpTransposeRule.java