private static boolean isPipe(FileSystem fs, FileStatus file) {
    if (fs instanceof DistributedFileSystem) {
      return false; // Shortcut for HDFS.
    }
    int mode = 0;
    Object pathToLog = file.getPath();
    try {
      java.nio.file.Path realPath = Paths.get(file.getPath().toUri());
      pathToLog = realPath;
      mode = (Integer)Files.getAttribute(realPath, "unix:mode");
    } catch (FileSystemNotFoundException t) {
      return false; // Probably not a local filesystem; no need to check.
    } catch (UnsupportedOperationException | IOException
        | SecurityException | IllegalArgumentException t) {
      LOG.info("Failed to check mode for " + pathToLog + ": "
        + t.getMessage() + " (" + t.getClass() + ")");
      return false;
    }
    return (mode & S_IFIFO) != 0;
  }
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