void exportFilesAsList() throws SemanticException {
    if (dataPathList.isEmpty()) {
      return;
    }
     Retryable retryable = Retryable.builder()
       .withHiveConf(hiveConf)
       .withRetryOnException(IOException.class).build();
     try {
       retryable.executeCallable((Callable<Void>) () -> {
         try (BufferedWriter writer = writer()) {
           for (Path dataPath : dataPathList) {
             writeFilesList(listFilesInDir(dataPath), writer, AcidUtils.getAcidSubDir(dataPath));
           }
         } catch (IOException e) {
           if (e instanceof FileNotFoundException) {
             logger.error("exporting data files in dir : " + dataPathList + " to " + exportRootDataDir + " failed");
             throw new FileNotFoundException(FILE_NOT_FOUND.format(e.getMessage()));
           }
           // in case of io error, reset the file system object
           FileSystem.closeAllForUGI(Utils.getUGI());
           dataFileSystem = dataPathList.get(0).getFileSystem(hiveConf);
           exportFileSystem = exportRootDataDir.getFileSystem(hiveConf);
           Path exportPath = new Path(exportRootDataDir, EximUtil.FILES_NAME);
           if (exportFileSystem.exists(exportPath)) {
             exportFileSystem.delete(exportPath, true);
           }
           throw e;
         }
         return null;
       });
     } catch (Exception e) {
       throw new SemanticException(e);
     }
  }
This needs the root data directory to which the data needs to be exported to.
The data export here is a list of files either in table/partition that are written to the _files
in the exportRootDataDir provided.
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/io/FileOperations.java