@SuppressWarnings("nls")
  public Path getBucketPath(int bucketNum) {
    // Note: this makes assumptions that won't work with MM tables, unions, etc.
    FileStatus srcs[] = getSortedPaths();
    if (srcs == null) {
      return null;
    }

    // Compute bucketid from srcs and return the 1st match.
    for (FileStatus src : srcs) {
      String bucketName = src.getPath().getName();
      String bucketIdStr = Utilities.getBucketFileNameFromPathSubString(bucketName);
      int bucketId = Utilities.getBucketIdFromFile(bucketIdStr);
      if (bucketId == bucketNum) {
        // match, return
        return src.getPath();
      }
    }
    return null;
  }
mapping from bucket number to bucket path
ql/src/java/org/apache/hadoop/hive/ql/metadata/Partition.java