Search in sources :

Example 1 with PRESENT

use of com.facebook.presto.orc.metadata.Stream.StreamKind.PRESENT in project presto by prestodb.

the class PresentOutputStream method getStreamDataOutput.

public Optional<StreamDataOutput> getStreamDataOutput(int column) {
    checkArgument(closed);
    if (booleanOutputStream == null) {
        return Optional.empty();
    }
    StreamDataOutput streamDataOutput = booleanOutputStream.getStreamDataOutput(column);
    // rewrite the DATA stream created by the boolean output stream to a PRESENT stream
    Stream stream = new Stream(column, PRESENT, toIntExact(streamDataOutput.size()), streamDataOutput.getStream().isUseVInts());
    return Optional.of(new StreamDataOutput(sliceOutput -> {
        streamDataOutput.writeData(sliceOutput);
        return stream.getLength();
    }, stream));
}
Also used : DwrfDataEncryptor(com.facebook.presto.orc.DwrfDataEncryptor) ColumnWriterOptions(com.facebook.presto.orc.ColumnWriterOptions) BooleanStreamCheckpoint(com.facebook.presto.orc.checkpoint.BooleanStreamCheckpoint) ArrayList(java.util.ArrayList) Preconditions.checkState(com.google.common.base.Preconditions.checkState) Stream(com.facebook.presto.orc.metadata.Stream) PRESENT(com.facebook.presto.orc.metadata.Stream.StreamKind.PRESENT) List(java.util.List) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) OrcOutputBuffer(com.facebook.presto.orc.OrcOutputBuffer) ClassLayout(org.openjdk.jol.info.ClassLayout) Optional(java.util.Optional) Math.toIntExact(java.lang.Math.toIntExact) Nullable(javax.annotation.Nullable) Stream(com.facebook.presto.orc.metadata.Stream)

Aggregations

ColumnWriterOptions (com.facebook.presto.orc.ColumnWriterOptions)1 DwrfDataEncryptor (com.facebook.presto.orc.DwrfDataEncryptor)1 OrcOutputBuffer (com.facebook.presto.orc.OrcOutputBuffer)1 BooleanStreamCheckpoint (com.facebook.presto.orc.checkpoint.BooleanStreamCheckpoint)1 Stream (com.facebook.presto.orc.metadata.Stream)1 PRESENT (com.facebook.presto.orc.metadata.Stream.StreamKind.PRESENT)1 Preconditions.checkArgument (com.google.common.base.Preconditions.checkArgument)1 Preconditions.checkState (com.google.common.base.Preconditions.checkState)1 Math.toIntExact (java.lang.Math.toIntExact)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Optional (java.util.Optional)1 Nullable (javax.annotation.Nullable)1 ClassLayout (org.openjdk.jol.info.ClassLayout)1