@Override
        public void onMatch(RelOptRuleCall call) {
          if (Bug.CALCITE_5669_FIXED) {
            throw new IllegalStateException("Class is redundant after fix is merged into Calcite");
          }
          final Correlate corr = call.rel(0);
          final RelNode left = call.rel(1);
          final RelBuilder b = call.builder();
          final RelNode newRel;
          switch (corr.getJoinType()) {
          case LEFT:
            newRel = padWithNulls(b, left, corr.getRowType(), false);
            break;
          case INNER:
          case SEMI:
            newRel = b.push(corr).empty().build();
            break;
          case ANTI:
            newRel = left;
            break;
          default:
            throw new IllegalStateException("Correlate does not support " + corr.getJoinType());
          }
          call.transformTo(newRel);
        }
Configuration for rule that prunes a correlate if right input is empty.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveRemoveEmptySingleRules.java