private static void checkSchema(RowSchema schema) {
    if (schema != null) {
    List<String> cn = schema.getColumnNames();
    Set<String> cn2 = new HashSet<>(cn);
    if (cn.size() != cn2.size()) {
        throw new RuntimeException("ambiguous columns in the schema!");
    }
    }
  }
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