private static boolean isSemiJoinRS(Operator<?> op) {
    if (op instanceof ReduceSinkOperator) {
      List<Operator<?>> children = op.getChildOperators();
      for (Operator<?> c : children) {
        if (!(c instanceof TableScanOperator)) {
          return false;
        }
      }
      return true;
    }
    return false;

  }
Checks some operator quality rules.

Checks whenever operator ids are not reused.
Checks some level of expression/schema consistency
Some sanity checks on SelectOperators
ql/src/java/org/apache/hadoop/hive/ql/hooks/OperatorHealthCheckerHook.java