@Override
  protected void doAlteration(Table table, Partition partition) throws HiveException {
    if (StatsSetupConst.USER.equals(environmentContext.getProperties().get(StatsSetupConst.STATS_GENERATED))) {
      environmentContext.getProperties().remove(StatsSetupConst.DO_NOT_UPDATE_STATS);
    }

    if (partition != null) {
      partition.getTPartition().getParameters().putAll(desc.getProps());
    } else {
      boolean isFromMmTable = AcidUtils.isInsertOnlyTable(table.getParameters());
      Boolean isToMmTable = AcidUtils.isToInsertOnlyTable(table, desc.getProps());
      boolean isToFullAcid = AcidUtils.isToFullAcid(table, desc.getProps());
      if (!isFromMmTable && BooleanUtils.isTrue(isToMmTable)) {
        if (!HiveConf.getBoolVar(context.getConf(), ConfVars.HIVE_MM_ALLOW_ORIGINALS)) {
          List<Task<?>> mmTasks = generateAddMmTasks(table, desc.getWriteId());
          for (Task<?> mmTask : mmTasks) {
            context.getTask().addDependentTask(mmTask);
          }
        } else {
          if (!table.getPartitionKeys().isEmpty()) {
            PartitionIterable parts = new PartitionIterable(context.getDb(), table, null,
                MetastoreConf.getIntVar(context.getConf(), MetastoreConf.ConfVars.BATCH_RETRIEVE_MAX));
            for (Partition part : parts) {
              checkMmLb(part);
            }
          } else {
            checkMmLb(table);
          }
        }
      } else if (isFromMmTable) {
        if (isToFullAcid) {
          table.getParameters().put(hive_metastoreConstants.TABLE_TRANSACTIONAL_PROPERTIES,
                  DEFAULT_TRANSACTIONAL_PROPERTY);
        } else if (BooleanUtils.isFalse(isToMmTable)) {
          throw new HiveException("Cannot convert an ACID table to non-ACID");
        }
      }

      // Converting to/from external table
      String externalProp = desc.getProps().get("EXTERNAL");
      if (externalProp != null) {
        if (Boolean.parseBoolean(externalProp) && table.getTableType() == TableType.MANAGED_TABLE) {
          table.setTableType(TableType.EXTERNAL_TABLE);
        } else if (!Boolean.parseBoolean(externalProp) && table.getTableType() == TableType.EXTERNAL_TABLE) {
          table.setTableType(TableType.MANAGED_TABLE);
        }
      }

      table.getTTable().getParameters().putAll(desc.getProps());
    }
  }
Operation process of setting properties of a table.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/misc/properties/AlterTableSetPropertiesOperation.java