private static boolean[] getPruneReduceSinkOpRetainFlags(
      List<String> retainedParentOpOutputCols, ReduceSinkOperator reduce) {
    ReduceSinkDesc reduceConf = reduce.getConf();
    List<ExprNodeDesc> originalValueEval = reduceConf.getValueCols();
    boolean[] flags = new boolean[originalValueEval.size()];
    for (int i = 0; i < originalValueEval.size(); i++) {
      flags[i] = false;
      List<String> current = originalValueEval.get(i).getCols();
      if (current == null || current.size() == 0) {
        flags[i] = true;
      } else {
        for (int j = 0; j < current.size(); j++) {
          if (retainedParentOpOutputCols.contains(current.get(j))) {
            flags[i] = true;
            break;
          }
        }
      }
    }
    return flags;
  }
since we pruned the select operator, we should let its children operator
know that. ReduceSinkOperator may send out every output columns of its
parent select. When the select operator is pruned, its child reduce
sink(direct child) operator should also be pruned.

@param op
@param retainedSelOutputCols
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/optimizer/ColumnPrunerProcFactory.java