private static void moveFiles(final FileSystem fs, final Path src, final Path dest)
      throws IOException {
    try {
      // create the dest directory if not exist
      if (!fs.exists(dest.getParent())) {
        fs.mkdirs(dest.getParent());
      }

      // if the destination file exists for some reason delete it
      fs.delete(dest, false);

      if (fs.rename(src, dest)) {
        System.err.println("Moved " + src + " to " + dest);
      } else {
        throw new IOException("Unable to move " + src + " to " + dest);
      }

    } catch (Exception e) {
      throw new IOException("Unable to move " + src + " to " + dest, e);
    }
  }
Utility to check and fix the ACID key index of an ORC file if it has been written incorrectly
due to HIVE-18817.
The condition that will be checked in the ORC file will be if the number of stripes in the
acid key index matches the number of stripes in the ORC StripeInformation.
ql/src/java/org/apache/hadoop/hive/ql/io/orc/FixAcidKeyIndex.java