@Override
  protected void doAlteration(Table table, Partition partition) throws HiveException {
    if (StatsSetupConst.USER.equals(environmentContext.getProperties().get(StatsSetupConst.STATS_GENERATED))) {
      // drop a stats parameter, which triggers recompute stats update automatically
      environmentContext.getProperties().remove(StatsSetupConst.DO_NOT_UPDATE_STATS);
    }

    if (partition == null) {
      Set<String> removedSet = desc.getProps().keySet();
      boolean isFromMmTable = AcidUtils.isInsertOnlyTable(table.getParameters());
      boolean isRemoved = AcidUtils.isRemovedInsertOnlyTable(removedSet);
      if (isFromMmTable && isRemoved) {
        throw new HiveException("Cannot convert an ACID table to non-ACID");
      }

      // Check if external table property being removed
      if (removedSet.contains("EXTERNAL") && table.getTableType() == TableType.EXTERNAL_TABLE) {
        table.setTableType(TableType.MANAGED_TABLE);
      }
    }
    for (String key : desc.getProps().keySet()) {
      if (partition != null) {
        partition.getTPartition().getParameters().remove(key);
      } else {
        table.getTTable().getParameters().remove(key);
      }
    }
  }
Operation process of unsetting properties of a table.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/misc/properties/AlterTableUnsetPropertiesOperation.java