public static void renameOrMoveFiles(FileSystem fs, Path src, Path dst) throws IOException,
      HiveException {
    if (!fs.exists(dst)) {
      if (!fs.rename(src, dst)) {
        throw new HiveException("Unable to move: " + src + " to: " + dst);
      }
    } else {
      // move file by file
      FileStatus[] files = fs.listStatus(src);
      for (FileStatus file : files) {
        Utilities.moveFileOrDir(fs, file, dst);
      }
    }
  }
Rename src to dst, or in the case dst already exists, move files in src to dst. If there is an
existing file with the same name, the new file's name will be generated based on the file name.
If the file name confirms to hive managed file NNNNNN_Y(_copy_YY) then it will create NNNNN_Y_copy_XX
else it will append _1, _2, ....

@param fs
         the FileSystem where src and dst are on.
@param src
         the src directory
@param dst
         the target directory
@throws IOException
ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java