protected static boolean hasGroupingSet(ReduceSinkOperator cRS) throws SemanticException {
    GroupByOperator cGBYm = getSingleParent(cRS, GroupByOperator.class);
    if (cGBYm != null && cGBYm.getConf().isGroupingSetsPresent()) {
      return true;
    }
    return false;
  }
Utilities for both CorrelationOptimizer and ReduceSinkDeDuplication.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/correlation/CorrelationUtilities.java