private static String replaceTaskId(String taskId, String strBucketNum) {
    Matcher m = PREFIXED_TASK_ID_REGEX.matcher(strBucketNum);
    if (!m.matches()) {
      LOG.warn("Unable to determine bucket number from file ID: {}. Using " +
          "file ID as bucket number.", strBucketNum);
      return adjustBucketNumLen(strBucketNum, taskId);
    } else {
      String adjustedBucketNum = adjustBucketNumLen(m.group(2), taskId);
      return (m.group(1) == null ? StringUtils.EMPTY : m.group(1)) + adjustedBucketNum;
    }
  }
Returns strBucketNum with enough 0's prefixing the task ID portion of the String to make it
equal in length to taskId

@param taskId - the taskId used as a template for length
@param strBucketNum - the bucket number of the output, may or may not be prefixed
@return
ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java