public static String makePartName(List<FieldSchema> partCols,
      List<String> vals, String defaultStr) throws MetaException {
    if ((partCols.size() != vals.size()) || (partCols.size() == 0)) {
      StringBuilder errorStrBuilder = new StringBuilder("Invalid partition key & values; keys [");
      for (FieldSchema fs : partCols) {
        errorStrBuilder.append(fs.getName()).append(", ");
      }
      errorStrBuilder.append("], values [");
      for (String val : vals) {
        errorStrBuilder.append(val).append(", ");
      }
      throw new MetaException(errorStrBuilder.append("]").toString());
    }
    List<String> colNames = new ArrayList<>();
    for (FieldSchema col: partCols) {
      colNames.add(col.getName());
    }
    return FileUtils.makePartName(colNames, vals, defaultStr);
  }
Makes a valid partition name.
@param partCols The partition columns
@param vals The partition values
@param defaultStr
   The default name given to a partition value if the respective value is empty or null.
@return An escaped, valid partition name.
@throws MetaException
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/Warehouse.java