private static void checkSelectOperator(SelectOperator op) {
    SelectDesc conf = op.getConf();
    RowSchema schema = op.getSchema();
    if (schema == null) {
      throw new RuntimeException("I expect a schema for all SelectOp" + op);
    }

    Set<String> cn = new HashSet<>(schema.getColumnNames());
    Set<String> ocn = new HashSet<>(conf.getOutputColumnNames());
    Set<String> diff = Sets.symmetricDifference(cn, ocn);
    if (!diff.isEmpty()) {
      throw new RuntimeException("SelOp output/schema mismatch ");
    }

  }
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