private boolean hasConstraintsEnabled(String tableName) throws SemanticException{
    NotNullConstraint notNullConstraint = null;
    DefaultConstraint defaultConstraint = null;
    try {
      // retrieve enabled NOT NULL constraint from metastore
      notNullConstraint = Hive.get().getEnabledNotNullConstraints(db.getDatabaseCurrent().getName(), tableName);
      defaultConstraint = Hive.get().getEnabledDefaultConstraints(db.getDatabaseCurrent().getName(), tableName);
    } catch (Exception e) {
      if (e instanceof SemanticException) {
        throw (SemanticException) e;
      } else {
        throw (new RuntimeException(e));
      }
    }
    return
        (notNullConstraint != null && !notNullConstraint.getNotNullConstraints().isEmpty()) ||
        (defaultConstraint != null && !defaultConstraint.getDefaultConstraints().isEmpty());
  }
@return If the alter changes table statistics
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/misc/properties/AbstractAlterTablePropertiesAnalyzer.java