Search in sources :

Example 1 with FloatStreamCheckpoint

use of com.facebook.presto.orc.checkpoint.FloatStreamCheckpoint in project presto by prestodb.

the class FloatColumnWriter method getIndexStreams.

@Override
public List<StreamDataOutput> getIndexStreams() throws IOException {
    checkState(closed);
    ImmutableList.Builder<RowGroupIndex> rowGroupIndexes = ImmutableList.builder();
    List<FloatStreamCheckpoint> dataCheckpoints = dataStream.getCheckpoints();
    Optional<List<BooleanStreamCheckpoint>> presentCheckpoints = presentStream.getCheckpoints();
    for (int i = 0; i < rowGroupColumnStatistics.size(); i++) {
        int groupId = i;
        ColumnStatistics columnStatistics = rowGroupColumnStatistics.get(groupId);
        FloatStreamCheckpoint dataCheckpoint = dataCheckpoints.get(groupId);
        Optional<BooleanStreamCheckpoint> presentCheckpoint = presentCheckpoints.map(checkpoints -> checkpoints.get(groupId));
        List<Integer> positions = createFloatColumnPositionList(compressed, dataCheckpoint, presentCheckpoint);
        rowGroupIndexes.add(new RowGroupIndex(positions, columnStatistics));
    }
    Slice slice = metadataWriter.writeRowIndexes(rowGroupIndexes.build());
    Stream stream = new Stream(column, StreamKind.ROW_INDEX, slice.length(), false);
    return ImmutableList.of(new StreamDataOutput(slice, stream));
}
Also used : ColumnStatistics(com.facebook.presto.orc.metadata.statistics.ColumnStatistics) BooleanStreamCheckpoint(com.facebook.presto.orc.checkpoint.BooleanStreamCheckpoint) ImmutableList(com.google.common.collect.ImmutableList) FloatStreamCheckpoint(com.facebook.presto.orc.checkpoint.FloatStreamCheckpoint) StreamDataOutput(com.facebook.presto.orc.stream.StreamDataOutput) FloatStreamCheckpoint(com.facebook.presto.orc.checkpoint.FloatStreamCheckpoint) BooleanStreamCheckpoint(com.facebook.presto.orc.checkpoint.BooleanStreamCheckpoint) RowGroupIndex(com.facebook.presto.orc.metadata.RowGroupIndex) Slice(io.airlift.slice.Slice) ArrayList(java.util.ArrayList) ImmutableList(com.google.common.collect.ImmutableList) List(java.util.List) PresentOutputStream(com.facebook.presto.orc.stream.PresentOutputStream) FloatOutputStream(com.facebook.presto.orc.stream.FloatOutputStream) Stream(com.facebook.presto.orc.metadata.Stream)

Example 2 with FloatStreamCheckpoint

use of com.facebook.presto.orc.checkpoint.FloatStreamCheckpoint in project presto by prestodb.

the class FloatOutputStream method recordCheckpoint.

@Override
public void recordCheckpoint() {
    checkState(!closed);
    checkpoints.add(new FloatStreamCheckpoint(buffer.getCheckpoint()));
}
Also used : FloatStreamCheckpoint(com.facebook.presto.orc.checkpoint.FloatStreamCheckpoint)

Aggregations

FloatStreamCheckpoint (com.facebook.presto.orc.checkpoint.FloatStreamCheckpoint)2 BooleanStreamCheckpoint (com.facebook.presto.orc.checkpoint.BooleanStreamCheckpoint)1 RowGroupIndex (com.facebook.presto.orc.metadata.RowGroupIndex)1 Stream (com.facebook.presto.orc.metadata.Stream)1 ColumnStatistics (com.facebook.presto.orc.metadata.statistics.ColumnStatistics)1 FloatOutputStream (com.facebook.presto.orc.stream.FloatOutputStream)1 PresentOutputStream (com.facebook.presto.orc.stream.PresentOutputStream)1 StreamDataOutput (com.facebook.presto.orc.stream.StreamDataOutput)1 ImmutableList (com.google.common.collect.ImmutableList)1 Slice (io.airlift.slice.Slice)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1