public static Path getCompactionResultDir(StorageDescriptor sd, ValidWriteIdList writeIds, HiveConf conf,
                                              boolean writingBase, boolean createDeleteDelta, boolean bucket0, AcidDirectory directory) {
      long minWriteID = writingBase ? 1 : getMinWriteID(directory);
      long highWatermark = writeIds.getHighWatermark();
      long compactorTxnId = Compactor.getCompactorTxnId(conf);
      AcidOutputFormat.Options options =
          new AcidOutputFormat.Options(conf).isCompressed(false).minimumWriteId(minWriteID)
              .maximumWriteId(highWatermark).statementId(-1).visibilityTxnId(compactorTxnId)
              .writingBase(writingBase).writingDeleteDelta(createDeleteDelta);
      if (bucket0) {
        options = options.bucket(0);
      }
      Path location = new Path(sd.getLocation());
      return AcidUtils.baseOrDeltaSubdirPath(location, options);
    }
Get the path of the base, delta, or delete delta directory that will be the final
destination of the files during compaction.

@param sd storage descriptor of table or partition to compact
@param writeIds list of valid writeids
@param conf HiveConf
@param writingBase if true, we are creating a base directory, otherwise a delta
@param createDeleteDelta if true, the delta dir we are creating is a delete delta
@param bucket0 whether to specify 0 as the bucketid
@param directory AcidUtils.Directory - only required for minor compaction result (delta) dirs

@return Path of new base/delta/delete delta directory
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/QueryCompactor.java