public static Map<String, String> getPartitionColtoTypeMap(List<FieldSchema> partitionCols) {
    Map<String, String> typeMap = new HashMap<>();

    if (partitionCols != null) {
      for (FieldSchema fSchema : partitionCols) {
        typeMap.put(fSchema.getName(), fSchema.getType());
      }
    }

    return typeMap;
  }
Get the partition name from the path.

@param tablePath
         Path of the table.
@param partitionPath
         Path of the partition.
@param partCols
         Set of partition columns from table definition
@return Partition name, for example partitiondate=2008-01-01
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreServerUtils.java