@Test
  public void testFileSystemIsNotInitializedWithKnownTail() throws IOException {
    JobConf conf = new JobConf();
    Path path = new Path("fmock:///testtable/bucket_0");
    conf.set("hive.orc.splits.include.file.footer", "true");
    conf.set("fs.defaultFS", "fmock:///");
    conf.set("fs.mock.impl", FailingMockFileSystem.class.getName());

    OrcProto.FileTail tail = OrcProto.FileTail.newBuilder()
        .setFooter(Footer.newBuilder()
            .addTypes(OrcProto.Type.newBuilder().setKind(OrcProto.Type.Kind.BINARY).build())
            .build())
        .build();
    OrcFile.ReaderOptions readerOptions = EncodedOrcFile.readerOptions(conf)
        .filesystem(() -> {
          throw new RuntimeException("Filesystem should not have been initialized");
        })
        .orcTail(new OrcTail(tail, new BufferChunk(0, 0), -1));

    // an orc reader is created, this should not cause filesystem initialization
    // because orc tail is already provided and we are not making any real reads.
    Reader reader = EncodedOrcFile.createReader(path, readerOptions);

    // Following initiates the creation of data reader in ORC reader. This should
    // not cause file system initialization either as we are still not making any
    // real read.
    reader.rows();
  }
Test to verify lazy nature of EncodedOrcFile.
ql/src/test/org/apache/hadoop/hive/ql/io/orc/encoded/TestEncodedOrcFile.java