Writer writer = new WriterImpl(fs, testFilePath, conf, inspector,
1000000, CompressionKind.NONE, 100, 10000, memory);
// Write 500 rows, they wil be directly encoded
for (int i = 0; i < 1000; i ++) {
writer.addRow(new StringStruct(Integer.toString(i)));
}
// Flush the first stripe
memory.forceFlushStripe();
// Write 500 more rows
for (int i = 0; i < 500; i ++) {
writer.addRow(new StringStruct(Integer.toString(i)));
}
// Force the writer to enter low memory mode
memory.forceEnterLowMemoryMode();
// Write 500 more rows
for (int i = 0; i < 500; i ++) {
writer.addRow(new StringStruct(Integer.toString(i + 500)));
}
writer.close();
Reader reader = OrcFile.createReader(fs, testFilePath, conf);
RecordReader rows = reader.rows(null);