private List<Task<?>> generateAddMmTasks(Table table, Long writeId) throws HiveException {
    // We will move all the files in the table/partition directories into the first MM
    // directory, then commit the first write ID.
    if (writeId == null) {
      throw new HiveException("Internal error - write ID not set for MM conversion");
    }

    List<Path> sources = new ArrayList<>();
    List<Path> targets = new ArrayList<>();

    int stmtId = 0;
    String mmDir = AcidUtils.deltaSubdir(writeId, writeId, stmtId);

    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);
        Path source = part.getDataLocation();
        Path target = new Path(source, mmDir);
        sources.add(source);
        targets.add(target);
        Utilities.FILE_OP_LOGGER.trace("Will move " + source + " to " + target);
      }
    } else {
      checkMmLb(table);
      Path source = table.getDataLocation();
      Path target = new Path(source, mmDir);
      sources.add(source);
      targets.add(target);
      Utilities.FILE_OP_LOGGER.trace("Will move " + source + " to " + target);
    }

    // Don't set inputs and outputs - the locks have already been taken so it's pointless.
    MoveWork mw = new MoveWork(null, null, null, null, false);
    mw.setMultiFilesDesc(new LoadMultiFilesDesc(sources, targets, true, null, null));
    return Lists.<Task<?>>newArrayList(TaskFactory.get(mw));
  }
Operation process of setting properties of a table.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/misc/properties/AlterTableSetPropertiesOperation.java