private List<Long> determineFileIdsToQuery(
      List<HdfsFileStatusWithId> files, OrcTail[] result, HashMap<Long, Integer> posMap) {
    for (int i = 0; i < result.length; ++i) {
      if (result[i] != null) {
        continue;
      }
      HdfsFileStatusWithId file = files.get(i);
      final FileStatus fs = file.getFileStatus();
      Long fileId = file.getFileId();
      if (fileId == null) {
        if (!isInTest) {
          if (!isWarnLogged || LOG.isDebugEnabled()) {
            LOG.warn("Not using metastore cache because fileId is missing: " + fs.getPath());
            isWarnLogged = true;
          }
          continue;
        }
        fileId = generateTestFileId(fs, files, i);
        LOG.info("Generated file ID " + fileId + " at " + i);
      }
      posMap.put(fileId, i);
    }
    return Lists.newArrayList(posMap.keySet());
  }
Metastore-based footer cache storing serialized footers. Also has a local cache.
ql/src/java/org/apache/hadoop/hive/ql/io/orc/ExternalCache.java