@Override
  protected void analyzeCommand(TableName tableName, Map<String, String> partitionSpec, ASTNode command)
      throws SemanticException {
    Map<String, String> properties = getProps((ASTNode) (command.getChild(0)).getChild(0));

    boolean updateStats = validate(tableName, properties);

    EnvironmentContext environmentContext = null;
    if (updateStats) {
      environmentContext = new EnvironmentContext();
      environmentContext.putToProperties(StatsSetupConst.STATS_GENERATED, StatsSetupConst.USER);
    }

    boolean isToTxn = AcidUtils.isTablePropertyTransactional(properties) ||
          properties.containsKey(hive_metastoreConstants.TABLE_TRANSACTIONAL_PROPERTIES);
    boolean isExplicitStatsUpdate = updateStats && AcidUtils.isTransactionalTable(getTable(tableName, true));

    AbstractAlterTableDesc desc = createDesc(command, tableName, partitionSpec, properties, isToTxn,
        isExplicitStatsUpdate, environmentContext);

    addInputsOutputsAlterTable(tableName, partitionSpec, desc, desc.getType(), isToTxn);
    DDLWork ddlWork = new DDLWork(getInputs(), getOutputs(), desc);
    if (isToTxn) {
      ddlWork.setNeedLock(true); // Hmm... why don't many other operations here need locks?
    }
    if (isToTxn || isExplicitStatsUpdate) {
      setAcidDdlDesc(desc);
    }

    rootTasks.add(TaskFactory.get(ddlWork));
  }
Analyzer for setting/unsetting the properties of table like entities commands.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/misc/properties/AbstractAlterTablePropertiesAnalyzer.java