public static String join(String... elements) {
    StringBuilder builder = new StringBuilder();
    for (String element : elements) {
      if (element == null || element.isEmpty()) {
        continue;
      }
      builder.append(element);
      if (!element.endsWith(Path.SEPARATOR)) {
        builder.append(Path.SEPARATOR);
      }
    }
    return builder.toString();
  }
Construct a list of full partition spec from Dynamic Partition Context and the directory names
corresponding to these dynamic partitions.
ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java