Search in sources :

Example 1 with DecimalStreamCheckpoint

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

the class DecimalOutputStream method recordCheckpoint.

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

Example 2 with DecimalStreamCheckpoint

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

the class DecimalColumnWriter method getIndexStreams.

@Override
public List<StreamDataOutput> getIndexStreams() throws IOException {
    checkState(closed);
    ImmutableList.Builder<RowGroupIndex> rowGroupIndexes = ImmutableList.builder();
    List<DecimalStreamCheckpoint> dataCheckpoints = dataStream.getCheckpoints();
    List<LongStreamCheckpoint> scaleCheckpoints = scaleStream.getCheckpoints();
    Optional<List<BooleanStreamCheckpoint>> presentCheckpoints = presentStream.getCheckpoints();
    for (int i = 0; i < rowGroupColumnStatistics.size(); i++) {
        int groupId = i;
        ColumnStatistics columnStatistics = rowGroupColumnStatistics.get(groupId);
        DecimalStreamCheckpoint dataCheckpoint = dataCheckpoints.get(groupId);
        LongStreamCheckpoint scaleCheckpoint = scaleCheckpoints.get(groupId);
        Optional<BooleanStreamCheckpoint> presentCheckpoint = presentCheckpoints.map(checkpoints -> checkpoints.get(groupId));
        List<Integer> positions = createDecimalColumnPositionList(compressed, dataCheckpoint, scaleCheckpoint, 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) StreamDataOutput(com.facebook.presto.orc.stream.StreamDataOutput) LongStreamCheckpoint(com.facebook.presto.orc.checkpoint.LongStreamCheckpoint) LongStreamCheckpoint(com.facebook.presto.orc.checkpoint.LongStreamCheckpoint) DecimalStreamCheckpoint(com.facebook.presto.orc.checkpoint.DecimalStreamCheckpoint) BooleanStreamCheckpoint(com.facebook.presto.orc.checkpoint.BooleanStreamCheckpoint) DecimalStreamCheckpoint(com.facebook.presto.orc.checkpoint.DecimalStreamCheckpoint) 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) LongOutputStream(com.facebook.presto.orc.stream.LongOutputStream) Stream(com.facebook.presto.orc.metadata.Stream) DecimalOutputStream(com.facebook.presto.orc.stream.DecimalOutputStream)

Aggregations

DecimalStreamCheckpoint (com.facebook.presto.orc.checkpoint.DecimalStreamCheckpoint)2 BooleanStreamCheckpoint (com.facebook.presto.orc.checkpoint.BooleanStreamCheckpoint)1 LongStreamCheckpoint (com.facebook.presto.orc.checkpoint.LongStreamCheckpoint)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 DecimalOutputStream (com.facebook.presto.orc.stream.DecimalOutputStream)1 LongOutputStream (com.facebook.presto.orc.stream.LongOutputStream)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