@Override
  public void run(HookContext hookContext) throws Exception {

    List<Node> rootOps = Lists.newArrayList();

    List<Task<?>> roots = hookContext.getQueryPlan().getRootTasks();
    for (Task<?> task : roots) {

      Object work = task.getWork();
      if (work instanceof MapredWork) {
        MapredWork mapredWork = (MapredWork) work;
        MapWork mapWork = mapredWork.getMapWork();
        if (mapWork != null) {
          rootOps.addAll(mapWork.getAllRootOperators());
        }
        ReduceWork reduceWork = mapredWork.getReduceWork();
        if (reduceWork != null) {
          rootOps.addAll(reduceWork.getAllRootOperators());
        }
      }
      if (work instanceof TezWork) {
        for (BaseWork bw : ((TezWork) work).getAllWorkUnsorted()) {
          rootOps.addAll(bw.getAllRootOperators());
        }
      }
    }
    walkTree(rootOps);
  }
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