private void moveTmpDirToIntermediateDir(Path intermediateArchivedDir, FileSystem fs, Path tmpPath)
      throws HiveException {
    try {
      context.getConsole().printInfo("Moving " + tmpPath + " to " + intermediateArchivedDir);
      if (HdfsUtils.pathExists(intermediateArchivedDir, context.getConf())) {
        throw new HiveException("The intermediate archive directory already exists.");
      }
      fs.rename(tmpPath, intermediateArchivedDir);
    } catch (IOException e) {
      throw new HiveException("Error while moving tmp directory");
    }
  }
Move from the tmp dir to an intermediate directory, in the same level as the partition directory.
e.g. .../hr=12-intermediate-archived
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/storage/archive/AlterTableArchiveOperation.java