@SuppressWarnings("unchecked")
  private static boolean checkTextInputFormat(FileSystem fs, HiveConf conf,
      List<FileStatus> files) throws HiveException {
    List<FileStatus> files2 = new LinkedList<>(files);
    Iterator<FileStatus> iter = files2.iterator();
    while (iter.hasNext()) {
      FileStatus file = iter.next();
      if (file == null) continue;
      if (isPipe(fs, file)) {
        LOG.info("Skipping format check for " + file.getPath() + " as it is a pipe");
        iter.remove();
      }
    }
    if (files2.isEmpty()) return true;
    Set<Class<? extends InputFormat>> inputFormatter = FileChecker.getInstance().registeredTextClasses();
    for (Class<? extends InputFormat> reg : inputFormatter) {
      boolean result = checkInputFormat(fs, conf, reg, files2);
      if (result) {
        return false;
      }
    }
    return true;
  }
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