static List<String> getBaseOrDeltaNames(FileSystem fs, PathFilter filter, Table table, String partitionName)
      throws IOException {
    Path path = partitionName == null ? new Path(table.getSd().getLocation()) : new Path(table.getSd().getLocation(),
        partitionName);
    FileStatus[] fileStatuses = filter != null ? fs.listStatus(path, filter) : fs.listStatus(path);
    return Arrays.stream(fileStatuses).map(FileStatus::getPath).map(Path::getName).sorted()
        .collect(Collectors.toList());
  }
Get a list of base/delta directory names.
@param fs the resolved file system
@param filter filter down the contents to delta/delete delta directories.
              If this is null, no filter is applied
@param table resolved table, where to search for delta directories
@param partitionName the name of the partition, can be null, if table is not partitioned
@return Collection of delta directory names, always non-null.
@throws IOException if table location is unreachable.
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/txn/compactor/CompactorTestUtil.java