use of org.apache.orc.NullMemoryManager in project presto by prestodb.
the class TestOrcReaderPositions method createFileWithOnlyUserMetadata.
private static void createFileWithOnlyUserMetadata(File file, Map<String, String> metadata) throws IOException {
Configuration conf = new Configuration();
OrcFile.WriterOptions writerOptions = OrcFile.writerOptions(conf).memory(new NullMemoryManager()).inspector(createSettableStructObjectInspector("test", BIGINT)).compress(SNAPPY);
Writer writer = OrcFile.createWriter(new Path(file.toURI()), writerOptions);
for (Map.Entry<String, String> entry : metadata.entrySet()) {
writer.addUserMetadata(entry.getKey(), ByteBuffer.wrap(entry.getValue().getBytes(UTF_8)));
}
writer.close();
}
Aggregations