protected void fixTmpPath(Path inputPath, int depthDiff) throws IOException {

    // don't need to update tmp paths when there is no depth difference in paths
    if (depthDiff <= 0) {
      return;
    }

    dpPath = inputPath;
    Path newPath = new Path(".");

    // Build the path from bottom up
    while (inputPath != null && depthDiff > 0) {
      newPath = new Path(inputPath.getName(), newPath);
      depthDiff--;
      inputPath = inputPath.getParent();
    }

    Path newTmpPath = new Path(tmpPath, newPath);
    if (!fs.exists(newTmpPath)) {
      if (Utilities.FILE_OP_LOGGER.isTraceEnabled()) {
        Utilities.FILE_OP_LOGGER.trace("Creating " + newTmpPath);
      }
      fs.mkdirs(newTmpPath);
    }

    Path newTaskTmpPath = (taskTmpPath != null) ? new Path(taskTmpPath, newPath) : null;
    updatePaths(newTmpPath, newTaskTmpPath);
  }
Fixes tmpPath to point to the correct partition. Initialize operator will
set tmpPath and taskTmpPath based on root table directory. So initially,
tmpPath will be &lt;prefix&gt;/_tmp.-ext-10000 and taskTmpPath will be
&lt;prefix&gt;/_task_tmp.-ext-10000. The depth of these two paths will be 0.
Now, in case of dynamic partitioning or list bucketing the inputPath will
have additional sub-directories under root table directory. This function
updates the tmpPath and taskTmpPath to reflect these additional
subdirectories. It updates tmpPath and taskTmpPath in the following way
1. finds out the difference in path based on depthDiff provided
and saves the path difference in newPath
2. newPath is used to update the existing tmpPath and taskTmpPath similar
to the way initializeOp() does.

Note: The path difference between inputPath and tmpDepth can be DP or DP+LB.
This method will automatically handle it.

Continuing the example above, if inputPath is &lt;prefix&gt;/-ext-10000/hr=a1/,
newPath will be hr=a1/. Then, tmpPath and taskTmpPath will be updated to
&lt;prefix&gt;/-ext-10000/hr=a1/_tmp.ext-10000 and
&lt;prefix&gt;/-ext-10000/hr=a1/_task_tmp.ext-10000 respectively.
We have list_bucket_dml_6.q cover this case: DP + LP + multiple skewed
values + merge.

@param inputPath - input path
@throws java.io.IOException
ql/src/java/org/apache/hadoop/hive/ql/exec/AbstractFileMergeOperator.java