code: @Override
    public void clean() throws IOException {
  
      List versions = Lists.newArrayList(this.hiveDatasetVersionFinder.findDatasetVersions(this));
  
      if (versions.isEmpty()) {
        log.warn(String.format("No dataset version can be found. Ignoring %s", this.getTable().getCompleteName()));
        return;
      }
  
      Collections.sort(versions, Collections.reverseOrder());
  
      Collection<HiveDatasetVersion> deletableVersions = this.hiveSelectionPolicy.listSelectedVersions(versions);
  
      log.info(String.format("Cleaning dataset %s .Will drop %s out of %s partitions.", datasetURN(), deletableVersions.size(),
          versions.size()));
  
      List<Exception> exceptions = Lists.newArrayList();
  
      for (HiveDatasetVersion hiveDatasetVersion : deletableVersions) {
        try {
          // Initialize the version cleaner
          HiveDatasetVersionCleaner hiveDatasetVersionCleaner = new HiveDatasetVersionCleaner(hiveDatasetVersion, this);
  
          // Perform pre-clean actions
          hiveDatasetVersionCleaner.preCleanAction();
  
          // Perform actual cleaning
          hiveDatasetVersionCleaner.clean();
  
          // Perform post-clean actions eg. swap partitions
          hiveDatasetVersionCleaner.postCleanAction();
        } catch (IOException e) {
          exceptions.add(e);
        }
      }
  
      if (!exceptions.isEmpty()) {
        throw new RuntimeException(String.format("Deletion failed for %s partitions", exceptions.size()));
      }
    }
docs: Drops the partitions selected by {@link #hiveSelectionPolicy}. Also deletes the data associated with it.
  <p>
  If an {@link Exception} occurs while processing a {@link Partition}, other {@link Partition}s will still be deleted.
  However, a {@link RuntimeException} is thrown at the end if there was at least one {@link Exception}.
  </p>