protected static boolean checkSelectSingleBranchOnly(ReduceSinkOperator cRS, ReduceSinkOperator pRS) {
    Operator<? extends OperatorDesc> parent = cRS.getParentOperators().get(0);
    if (cRS.getConf().getBucketingVersion() != pRS.getConf().getBucketingVersion()) {
      return false;
    }
    while (parent != pRS) {
      assert parent.getNumParent() == 1;
      if (!(parent instanceof SelectOperator)) {
        return false;
      }
      if (parent.getChildOperators().size() > 1) {
        return false;
      }

      parent = parent.getParentOperators().get(0);
    }
    return true;
  }
If number of reducers for RS is -1, the RS can have any number of reducers.
It's generally true except for order-by or forced bucketing cases.
if both of num-reducers are not -1, those number should be the same.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/correlation/ReduceSinkDeDuplicationUtils.java