public String getPartitionActualName(Partition pt) {
    Map<String, PrimitiveObjectInspector.PrimitiveCategory> columnsToPrimitiveCategoryMap =
        getPartitionColumnToPrimitiveCategory(pt);
    String[] partColsDef = pt.getName().split("/");
    List<String> ptParam = new ArrayList<>();
    for (String partCol : partColsDef) {
      String[] colValue = partCol.split("=");
      ptParam.add(unparseIdentifier(colValue[0]) + "=" +
          TypeInfoUtils.convertStringToLiteralForSQL(colValue[1], columnsToPrimitiveCategoryMap.get(colValue[0])));
    }
    return StringUtils.join(ptParam, ",");
  }
Returns the create database query for a give database name.

@param dbNames
@return
ql/src/java/org/apache/hadoop/hive/ql/exec/DDLPlanUtils.java