public static PartitionDesc partitionDescForPath(Path path, Map<Path, PartitionDesc> partitionDescMap) {
    assert(partitionDescMap != null);

    // Look for PartitionDesc instance matching our Path
    Path parentPath = path;
    PartitionDesc part = partitionDescMap.get(parentPath);
    while (!parentPath.isRoot() && part == null) {
      parentPath = parentPath.getParent();
      part = partitionDescMap.get(parentPath);
    }
    return part;
  }
Takes a Path and looks up the PartitionDesc instance associated with it in a map of Path-&gt;PartitionDesc entries.
If it is not found (e.g. Path denotes a partition path, but map contains table level instances only) we will try
to do the same with the parent of this path, traversing up until there's a match, if any.
@param path the absolute path used for the look up
@param partitionDescMap the map
@return the PartitionDesc instance if found, null if not found
ql/src/java/org/apache/hadoop/hive/llap/LlapHiveUtils.java