private boolean validate(TableName tableName, Map<String, String> properties) throws SemanticException {
    // We need to check if the properties are valid, especially for stats.
    boolean changeStats = false;
    for (Entry<String, String> entry : properties.entrySet()) {
      // Stats can be changed via alter table .. update statistics or alter table .. set tblproperties.
      // If the property is not numRows or rawDataSize, it cannot be changed through update statistics.
      if ((queryState.getCommandType().equals(HiveOperation.ALTERTABLE_UPDATETABLESTATS.getOperationName()) ||
              queryState.getCommandType().equals(HiveOperation.ALTERTABLE_UPDATEPARTSTATS.getOperationName()))
              && !entry.getKey().equals(StatsSetupConst.ROW_COUNT) && !entry.getKey().equals(StatsSetupConst.RAW_DATA_SIZE)) {
        throw new SemanticException(String.format(
                  "AlterTable UpdateStats %s failed because the only valid keys are %s and %s",
                  entry.getKey(), StatsSetupConst.ROW_COUNT, StatsSetupConst.RAW_DATA_SIZE));
      }
      // We can update all table stats through SET TBLPROPERTIES. Validating if the value is a Long
      if (StatsSetupConst.STATS_NUMERIC.contains(entry.getKey())) {
        try {
          Long.parseLong(entry.getValue());
          changeStats = true;
        } catch (Exception e) {
          throw new SemanticException("AlterTable " + entry.getKey() + " failed with value " + entry.getValue());
        }
      } else if (entry.getKey().equals("external") && entry.getValue().equals("true")) {
        // if table is being modified to be external we need to make sure existing table
        // doesn't have enabled constraint since constraints are disallowed with such tables
        if (hasConstraintsEnabled(tableName.getTable())) {
          throw new SemanticException(ErrorMsg.INVALID_CSTR_SYNTAX.getMsg(String.format(
              "Table: %s has constraints enabled. Please remove those constraints to change this property.",
              tableName.getNotEmptyDbTable())));
        }
      }
    }
    return changeStats;
  }
@return If the alter changes table statistics
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/misc/properties/AbstractAlterTablePropertiesAnalyzer.java