@Override
    public FileStats call() throws Exception {
      try (org.apache.hadoop.mapred.RecordReader<?, ?> recordReader = inputFormat
          .getRecordReader(dummySplit, jc, Reporter.NULL)) {
        if (recordReader instanceof StatsProvidingRecordReader) {
          StatsProvidingRecordReader statsRR;
          statsRR = (StatsProvidingRecordReader) recordReader;
          final FileStats fileStats =
              new FileStats(statsRR.getStats().getRawDataSize(), statsRR.getStats().getRowCount(), file.getLen(),
                  file.isErasureCoded());
          return fileStats;
        } else {
          throw new HiveException(String.format("Unexpected file found during reading footers for: %s ", file));
        }
      }
    }
Utility class to process file level stats in parallel.
ql/src/java/org/apache/hadoop/hive/ql/stats/BasicStatsNoJobTask.java