@Test
  public void testBitPack64Large() throws Exception {
    ObjectInspector inspector;
    synchronized (TestOrcFile.class) {
      inspector = ObjectInspectorFactory.getReflectionObjectInspector(Long.class,
          ObjectInspectorFactory.ObjectInspectorOptions.JAVA);
    }

    int size = 1080832;
    long[] inp = new long[size];
    Random rand = new Random(1234);
    for (int i = 0; i < size; i++) {
      inp[i] = rand.nextLong();
    }
    List<Long> input = Lists.newArrayList(Longs.asList(inp));

    Writer writer = OrcFile.createWriter(testFilePath,
        OrcFile.writerOptions(conf).inspector(inspector).compress(CompressionKind.ZLIB));
    for (Long l : input) {
      writer.addRow(l);
    }
    writer.close();

    Reader reader = OrcFile.createReader(testFilePath, OrcFile.readerOptions(conf).filesystem(fs));
    RecordReader rows = reader.rows();
    int idx = 0;
    while (rows.hasNext()) {
      Object row = rows.next(null);
      Assert.assertEquals(input.get(idx++).longValue(), ((LongWritable) row).get());
    }
    rows.close();
  }
Read and write a randomly generated snappy file.
@throws Exception
ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestOrcFile.java