@VisibleForTesting
  protected static boolean shouldMergeMovePaths(HiveConf conf, Path condInputPath, Path condOutputPath, MoveWork linkedMoveWork) {
    Path linkedSourcePath, linkedTargetPath;

    if (linkedMoveWork == null || !BlobStorageUtils.areOptimizationsEnabled(conf)) {
      return false;
    }

    if (linkedMoveWork.getLoadFileWork() != null && linkedMoveWork.getLoadTableWork() == null) {
      linkedSourcePath = linkedMoveWork.getLoadFileWork().getSourcePath();
      linkedTargetPath = linkedMoveWork.getLoadFileWork().getTargetDir();
    } else if (linkedMoveWork.getLoadTableWork() != null && linkedMoveWork.getLoadFileWork() == null) {
      linkedSourcePath = linkedMoveWork.getLoadTableWork().getSourcePath();
      linkedTargetPath = getTableLocationPath(conf, linkedMoveWork.getLoadTableWork().getTable());
    } else {
      return false;
    }

    return condOutputPath.equals(linkedSourcePath)
        && BlobStorageUtils.isBlobStoragePath(conf, condInputPath)
        && BlobStorageUtils.isBlobStoragePath(conf, linkedTargetPath);
  }
Checks whether the given input/output paths and a linked MoveWork should be merged into one only MoveWork.
This is an optimization for BlobStore systems to avoid doing two renames/copies that are not necessary.

@param conf A HiveConf object to check if BlobStorage optimizations are enabled.
@param condInputPath A path that the ConditionalTask uses as input for its sub-tasks.
@param condOutputPath A path that the ConditionalTask uses as output for its sub-tasks.
@param linkedMoveWork A MoveWork that the ConditionalTask uses to link to its sub-tasks.
@return True if both Conditional input/output paths and the linked MoveWork should be merged.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java