use of io.trino.orc.metadata.Stream.StreamKind.PRESENT in project trino by trinodb.
the class PresentOutputStream method getStreamDataOutput.
public Optional<StreamDataOutput> getStreamDataOutput(OrcColumnId columnId) {
checkArgument(closed);
if (booleanOutputStream == null) {
return Optional.empty();
}
StreamDataOutput streamDataOutput = booleanOutputStream.getStreamDataOutput(columnId);
// rewrite the DATA stream created by the boolean output stream to a PRESENT stream
Stream stream = new Stream(columnId, PRESENT, toIntExact(streamDataOutput.size()), streamDataOutput.getStream().isUseVInts());
return Optional.of(new StreamDataOutput(sliceOutput -> {
streamDataOutput.writeData(sliceOutput);
return stream.getLength();
}, stream));
}
Aggregations