private static ArrayList<String> getListing(String dbName, String tableName, Hive hiveDb, HiveConf conf)
      throws HiveException, IOException {
    ArrayList<String> paths = new ArrayList<>();
    Table table = hiveDb.getTable(dbName, tableName, false);
    if (table == null) {
      LOG.info("Table {} not found, excluding the dropped table", tableName);
      // If the table is not there, return an empty list of paths, we would need to copy the entire stuff.
      return new ArrayList<>();
    }
    Path tableLocation = new Path(table.getSd().getLocation());
    paths.add(table.getSd().getLocation());
    FileSystem tableFs = tableLocation.getFileSystem(conf);
    buildListingForDirectory(paths, tableLocation, tableFs);
    // Check if the table is partitioned, in case the table is partitioned we need to check for the partitions
    // listing as well.
    if (table.isPartitioned()) {
      GetProjectionsSpec getProjectionsSpec = new GetPartitionProjectionsSpecBuilder()
          .addProjectFieldList(Arrays.asList("sd.location")).build();
      GetPartitionsRequest request = new GetPartitionsRequest(table.getDbName(), table.getTableName(),
          getProjectionsSpec, null);
      request.setCatName(table.getCatName());
      List<Partition> partitions;
      try {
        partitions = hiveDb.getPartitionsWithSpecs(table, request);
      } catch (Exception e) {
        throw new HiveException(e);
      }
      for (Partition part : partitions) {
        Path partPath = part.getDataLocation();
        // Build listing for the partition only if it doesn't lies within the table location, else it would have been
        // already included as part of recursive listing of table directory.
        if (!FileUtils.isPathWithinSubtree(partPath, tableLocation)) {
          buildListingForDirectory(paths, partPath, tableFs);
        }
      }
    }
    return paths;
  }
Gets the list of tables for the second load of optimised bootstrap from the BOOTSTRAP_TABLE_LIST in the dump
directory.
@param dumpPath the dump path
@param conf the hive configuration
@return the array with list of tables to bootstrap
@throws IOException in case of any exception.
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/OptimisedBootstrapUtils.java