private static boolean areMergeableDppUnion(ParseContext pctx,
      SharedWorkOptimizerCache optimizerCache, TableScanOperator tsOp1, TableScanOperator tsOp2)
      throws SemanticException {

    if (!areSupportedDppUnionOps(pctx, optimizerCache, tsOp1, tsOp2)) {
      return false;
    }
    if (!areSupportedDppUnionOps(pctx, optimizerCache, tsOp2, tsOp1)) {
      return false;
    }
    return true;
  }
Orders TS operators in decreasing order by "weight".
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SharedWorkOptimizer.java