private static <T> T getFromPath(
      Map<Path, T> pathToPartitionInfo, Path dir) {
    
    // We first do exact match, and then do prefix matching. The latter is due to input dir
    // could be /dir/ds='2001-02-21'/part-03 where part-03 is not part of partition
    Path path = FileUtils.getParentRegardlessOfScheme(dir,pathToPartitionInfo.keySet());
    
    if(path == null) {
      // FIXME: old implementation returned null; exception maybe?
      return null;
    }
    return pathToPartitionInfo.get(path);
  }
Checks if files are in same format as the given input format.

Note: an empty set of files is considered compliant.
ql/src/java/org/apache/hadoop/hive/ql/io/HiveFileFormatUtils.java