Search in sources :

Example 1 with SliceDirectColumnWriter

use of com.facebook.presto.orc.writer.SliceDirectColumnWriter in project presto by prestodb.

the class BenchmarkDictionaryWriter method writeDirect.

@Benchmark
public void writeDirect(BenchmarkData data) {
    ColumnWriter columnWriter;
    Type type = data.getType();
    if (type.equals(VARCHAR)) {
        columnWriter = new SliceDirectColumnWriter(COLUMN_INDEX, type, getColumnWriterOptions(), Optional.empty(), DWRF, this::newStringStatisticsBuilder, DWRF.createMetadataWriter());
    } else {
        columnWriter = new LongColumnWriter(COLUMN_INDEX, type, getColumnWriterOptions(), Optional.empty(), DWRF, IntegerStatisticsBuilder::new, DWRF.createMetadataWriter());
    }
    for (Block block : data.getBlocks()) {
        columnWriter.beginRowGroup();
        columnWriter.writeBlock(block);
        columnWriter.finishRowGroup();
    }
    columnWriter.close();
    columnWriter.reset();
}
Also used : SliceDirectColumnWriter(com.facebook.presto.orc.writer.SliceDirectColumnWriter) Type(com.facebook.presto.common.type.Type) Block(com.facebook.presto.common.block.Block) SliceDirectColumnWriter(com.facebook.presto.orc.writer.SliceDirectColumnWriter) ColumnWriter(com.facebook.presto.orc.writer.ColumnWriter) LongColumnWriter(com.facebook.presto.orc.writer.LongColumnWriter) DictionaryColumnWriter(com.facebook.presto.orc.writer.DictionaryColumnWriter) SliceDictionaryColumnWriter(com.facebook.presto.orc.writer.SliceDictionaryColumnWriter) LongDictionaryColumnWriter(com.facebook.presto.orc.writer.LongDictionaryColumnWriter) LongColumnWriter(com.facebook.presto.orc.writer.LongColumnWriter) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Aggregations

Block (com.facebook.presto.common.block.Block)1 Type (com.facebook.presto.common.type.Type)1 ColumnWriter (com.facebook.presto.orc.writer.ColumnWriter)1 DictionaryColumnWriter (com.facebook.presto.orc.writer.DictionaryColumnWriter)1 LongColumnWriter (com.facebook.presto.orc.writer.LongColumnWriter)1 LongDictionaryColumnWriter (com.facebook.presto.orc.writer.LongDictionaryColumnWriter)1 SliceDictionaryColumnWriter (com.facebook.presto.orc.writer.SliceDictionaryColumnWriter)1 SliceDirectColumnWriter (com.facebook.presto.orc.writer.SliceDirectColumnWriter)1 Benchmark (org.openjdk.jmh.annotations.Benchmark)1