Search in sources :

Example 1 with LongOutputStreamDwrf

use of com.facebook.presto.orc.stream.LongOutputStreamDwrf in project presto by prestodb.

the class TestLongDictionaryProvider method createSliceOutput.

private DynamicSliceOutput createSliceOutput(StreamId streamId, long[] data) {
    LongOutputStreamDwrf outputStream = new LongOutputStreamDwrf(getColumnWriterOptions(), Optional.empty(), true, DICTIONARY_DATA);
    for (long val : data) {
        outputStream.writeLong(val);
    }
    outputStream.close();
    DynamicSliceOutput sliceOutput = new DynamicSliceOutput(1000);
    StreamDataOutput streamDataOutput = outputStream.getStreamDataOutput(streamId.getColumn());
    streamDataOutput.writeData(sliceOutput);
    return sliceOutput;
}
Also used : LongOutputStreamDwrf(com.facebook.presto.orc.stream.LongOutputStreamDwrf) DynamicSliceOutput(io.airlift.slice.DynamicSliceOutput) StreamDataOutput(com.facebook.presto.orc.stream.StreamDataOutput)

Example 2 with LongOutputStreamDwrf

use of com.facebook.presto.orc.stream.LongOutputStreamDwrf in project presto by prestodb.

the class LongDictionaryColumnWriter method resetDictionary.

@Override
protected void resetDictionary() {
    columnEncoding = null;
    dictionary = new LongDictionaryBuilder(EXPECTED_ENTRIES);
    dictionaryDataStream = new LongOutputStreamDwrf(columnWriterOptions, dwrfEncryptor, true, DICTIONARY_DATA);
    statisticsBuilder = new IntegerStatisticsBuilder();
}
Also used : LongOutputStreamDwrf(com.facebook.presto.orc.stream.LongOutputStreamDwrf) IntegerStatisticsBuilder(com.facebook.presto.orc.metadata.statistics.IntegerStatisticsBuilder)

Aggregations

LongOutputStreamDwrf (com.facebook.presto.orc.stream.LongOutputStreamDwrf)2 IntegerStatisticsBuilder (com.facebook.presto.orc.metadata.statistics.IntegerStatisticsBuilder)1 StreamDataOutput (com.facebook.presto.orc.stream.StreamDataOutput)1 DynamicSliceOutput (io.airlift.slice.DynamicSliceOutput)1