Search in sources :

Example 1 with LongDecimalStatisticsBuilder

use of com.facebook.presto.orc.metadata.statistics.LongDecimalStatisticsBuilder in project urban-eureka by errir503.

the class DecimalColumnWriter method finishRowGroup.

@Override
public Map<Integer, ColumnStatistics> finishRowGroup() {
    checkState(!closed);
    ColumnStatistics statistics;
    if (type.isShort()) {
        statistics = shortDecimalStatisticsBuilder.buildColumnStatistics();
        shortDecimalStatisticsBuilder = new ShortDecimalStatisticsBuilder(type.getScale());
    } else {
        statistics = longDecimalStatisticsBuilder.buildColumnStatistics();
        longDecimalStatisticsBuilder = new LongDecimalStatisticsBuilder();
    }
    rowGroupColumnStatistics.add(statistics);
    columnStatisticsRetainedSizeInBytes += statistics.getRetainedSizeInBytes();
    return ImmutableMap.of(column, statistics);
}
Also used : ColumnStatistics(com.facebook.presto.orc.metadata.statistics.ColumnStatistics) LongDecimalStatisticsBuilder(com.facebook.presto.orc.metadata.statistics.LongDecimalStatisticsBuilder) ShortDecimalStatisticsBuilder(com.facebook.presto.orc.metadata.statistics.ShortDecimalStatisticsBuilder)

Example 2 with LongDecimalStatisticsBuilder

use of com.facebook.presto.orc.metadata.statistics.LongDecimalStatisticsBuilder in project urban-eureka by errir503.

the class DecimalColumnWriter method reset.

@Override
public void reset() {
    closed = false;
    dataStream.reset();
    scaleStream.reset();
    presentStream.reset();
    rowGroupColumnStatistics.clear();
    columnStatisticsRetainedSizeInBytes = 0;
    shortDecimalStatisticsBuilder = new ShortDecimalStatisticsBuilder(this.type.getScale());
    longDecimalStatisticsBuilder = new LongDecimalStatisticsBuilder();
}
Also used : LongDecimalStatisticsBuilder(com.facebook.presto.orc.metadata.statistics.LongDecimalStatisticsBuilder) ShortDecimalStatisticsBuilder(com.facebook.presto.orc.metadata.statistics.ShortDecimalStatisticsBuilder)

Example 3 with LongDecimalStatisticsBuilder

use of com.facebook.presto.orc.metadata.statistics.LongDecimalStatisticsBuilder in project presto by prestodb.

the class DecimalColumnWriter method reset.

@Override
public void reset() {
    closed = false;
    dataStream.reset();
    scaleStream.reset();
    presentStream.reset();
    rowGroupColumnStatistics.clear();
    columnStatisticsRetainedSizeInBytes = 0;
    shortDecimalStatisticsBuilder = new ShortDecimalStatisticsBuilder(this.type.getScale());
    longDecimalStatisticsBuilder = new LongDecimalStatisticsBuilder();
}
Also used : LongDecimalStatisticsBuilder(com.facebook.presto.orc.metadata.statistics.LongDecimalStatisticsBuilder) ShortDecimalStatisticsBuilder(com.facebook.presto.orc.metadata.statistics.ShortDecimalStatisticsBuilder)

Example 4 with LongDecimalStatisticsBuilder

use of com.facebook.presto.orc.metadata.statistics.LongDecimalStatisticsBuilder in project presto by prestodb.

the class DecimalColumnWriter method finishRowGroup.

@Override
public Map<Integer, ColumnStatistics> finishRowGroup() {
    checkState(!closed);
    ColumnStatistics statistics;
    if (type.isShort()) {
        statistics = shortDecimalStatisticsBuilder.buildColumnStatistics();
        shortDecimalStatisticsBuilder = new ShortDecimalStatisticsBuilder(type.getScale());
    } else {
        statistics = longDecimalStatisticsBuilder.buildColumnStatistics();
        longDecimalStatisticsBuilder = new LongDecimalStatisticsBuilder();
    }
    rowGroupColumnStatistics.add(statistics);
    columnStatisticsRetainedSizeInBytes += statistics.getRetainedSizeInBytes();
    return ImmutableMap.of(column, statistics);
}
Also used : ColumnStatistics(com.facebook.presto.orc.metadata.statistics.ColumnStatistics) LongDecimalStatisticsBuilder(com.facebook.presto.orc.metadata.statistics.LongDecimalStatisticsBuilder) ShortDecimalStatisticsBuilder(com.facebook.presto.orc.metadata.statistics.ShortDecimalStatisticsBuilder)

Aggregations

LongDecimalStatisticsBuilder (com.facebook.presto.orc.metadata.statistics.LongDecimalStatisticsBuilder)4 ShortDecimalStatisticsBuilder (com.facebook.presto.orc.metadata.statistics.ShortDecimalStatisticsBuilder)4 ColumnStatistics (com.facebook.presto.orc.metadata.statistics.ColumnStatistics)2