private static HiveOutputFormat<?, ?> getHiveOutputFormat(
      Configuration conf, Class<? extends OutputFormat> outputClass) throws HiveException {
    OutputFormat<?, ?> outputFormat = ReflectionUtil.newInstance(outputClass, conf);
    if (!(outputFormat instanceof HiveOutputFormat)) {
      outputFormat = new HivePassThroughOutputFormat(outputFormat);
    }
    return (HiveOutputFormat<?, ?>) outputFormat;
  }
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