public static void checkOperator(Operator<?> op) {
    OperatorDesc conf = op.getConf();
    Map<String, ExprNodeDesc> exprMap = conf.getColumnExprMap();
    RowSchema schema = op.getSchema();

    checkSchema(schema);
    if (op instanceof SelectOperator) {
      checkSelectOperator((SelectOperator) op);
    }
    if (schema != null && exprMap != null) {
      for (Entry<String, ExprNodeDesc> c : exprMap.entrySet()) {
        if (c.getValue() instanceof ExprNodeConstantDesc) {
          continue;
        }
        ColumnInfo ci = schema.getColumnInfo(c.getKey());
        if (c.getKey().startsWith(Utilities.ReduceField.KEY + ".reducesinkkey")) {
          continue;
        }
        if (ci == null && conf.getComputedFields().contains(c.getKey())) {
          continue;
        }
        if (ci == null) {
          throw new RuntimeException("schema not found for " + c + " in " + schema);
        }
      }
      for (ColumnInfo sig : schema.getSignature()) {
        if (op instanceof ScriptOperator) {
          continue;
        }
        String iName = sig.getInternalName();
        ExprNodeDesc e = exprMap.get(iName);
        if (isSemiJoinRS(op)) {
          continue;
        }
        if (op.getConf() instanceof GroupByDesc) {
          continue;
        }

        if (e == null) {
          throw new RuntimeException("expr not found for " + iName + " in " + exprMap);
        }
      }
    }

  }
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