Search in sources :

Example 1 with FloatStreamCheckpoint

use of io.prestosql.orc.checkpoint.FloatStreamCheckpoint in project hetu-core by openlookeng.

the class FloatColumnWriter method getIndexStreams.

@Override
public List<StreamDataOutput> getIndexStreams(CompressedMetadataWriter metadataWriter) 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(columnId, StreamKind.ROW_INDEX, slice.length(), false);
    return ImmutableList.of(new StreamDataOutput(slice, stream));
}
Also used : ColumnStatistics(io.prestosql.orc.metadata.statistics.ColumnStatistics) BooleanStreamCheckpoint(io.prestosql.orc.checkpoint.BooleanStreamCheckpoint) ImmutableList(com.google.common.collect.ImmutableList) FloatStreamCheckpoint(io.prestosql.orc.checkpoint.FloatStreamCheckpoint) StreamDataOutput(io.prestosql.orc.stream.StreamDataOutput) BooleanStreamCheckpoint(io.prestosql.orc.checkpoint.BooleanStreamCheckpoint) FloatStreamCheckpoint(io.prestosql.orc.checkpoint.FloatStreamCheckpoint) RowGroupIndex(io.prestosql.orc.metadata.RowGroupIndex) Slice(io.airlift.slice.Slice) ArrayList(java.util.ArrayList) ImmutableList(com.google.common.collect.ImmutableList) List(java.util.List) PresentOutputStream(io.prestosql.orc.stream.PresentOutputStream) Stream(io.prestosql.orc.metadata.Stream) FloatOutputStream(io.prestosql.orc.stream.FloatOutputStream)

Example 2 with FloatStreamCheckpoint

use of io.prestosql.orc.checkpoint.FloatStreamCheckpoint in project hetu-core by openlookeng.

the class FloatOutputStream method recordCheckpoint.

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

Aggregations

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