private String prependPartSpec(String inputPath, String fileName) {
    Map<String, String> mapping = inputToPartSpecMapping == null ?
        inputToPartSpecMapping = revert(bigTablePartSpecToFileMapping) : inputToPartSpecMapping;
    String partSpec = mapping.get(URI.create(inputPath).getPath());
    return partSpec == null || partSpec.isEmpty() ? fileName :
      "(" + FileUtils.escapePathName(partSpec) + ")" + fileName;
  }
Given a small table input file, find the mapping
big table input file with the smallest bucket number.
ql/src/java/org/apache/hadoop/hive/ql/plan/BucketMapJoinContext.java