@Override
  protected void doAlteration(Table table, Partition partition) throws HiveException {
    StorageDescriptor sd = getStorageDescriptor(table, partition);
    String newLocation = desc.getLocation();

    try {
      URI locUri = new URI(newLocation);
      if (!new Path(locUri).isAbsolute()) {
        throw new HiveException(ErrorMsg.BAD_LOCATION_VALUE, newLocation);
      }
      sd.setLocation(newLocation);
    } catch (URISyntaxException e) {
      throw new HiveException(e);
    }
    environmentContext.getProperties().remove(StatsSetupConst.DO_NOT_UPDATE_STATS);
  }
Operation process of setting the location of a table.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/storage/set/location/AlterTableSetLocationOperation.java