public static Path registerFile(DataCache cache, Path path, Object fileKey,
      TreeMap<Long, Long> index, Configuration conf, CacheTag tag) throws IOException {
    long splitId = currentSplitId.incrementAndGet();
    CacheAwareInputStream stream = new CacheAwareInputStream(
        cache, conf, index, path, fileKey, -1, tag);
    if (files.putIfAbsent(splitId, stream) != null) {
      throw new IOException("Record already exists for " + splitId);
    }
    conf.set("fs." + LlapCacheAwareFs.SCHEME + ".impl", LlapCacheAwareFs.class.getCanonicalName());
    return new Path(SCHEME + "://" + SCHEME + "/" + splitId);
  }
This is currently only used by Parquet; however, a generally applicable approach is used -
you pass in a set of offset pairs for a file, and the file is cached with these boundaries.
Don't add anything format specific here.
ql/src/java/org/apache/hadoop/hive/llap/LlapCacheAwareFs.java