Search in sources :

Example 1 with DecimalStatistics

use of io.prestosql.orc.metadata.statistics.DecimalStatistics in project hetu-core by openlookeng.

the class OrcMetadataReader method toDecimalStatistics.

private static DecimalStatistics toDecimalStatistics(OrcProto.DecimalStatistics decimalStatistics) {
    BigDecimal minimum = decimalStatistics.hasMinimum() ? new BigDecimal(decimalStatistics.getMinimum()) : null;
    BigDecimal maximum = decimalStatistics.hasMaximum() ? new BigDecimal(decimalStatistics.getMaximum()) : null;
    // could be long (16 bytes) or short (8 bytes); use short for estimation
    return new DecimalStatistics(minimum, maximum, SHORT_DECIMAL_VALUE_BYTES);
}
Also used : DecimalStatistics(io.prestosql.orc.metadata.statistics.DecimalStatistics) BigDecimal(java.math.BigDecimal)

Example 2 with DecimalStatistics

use of io.prestosql.orc.metadata.statistics.DecimalStatistics in project hetu-core by openlookeng.

the class TestTupleDomainOrcPredicate method decimalColumnStats.

private static ColumnStatistics decimalColumnStats(Long numberOfValues, String minimum, String maximum) {
    BigDecimal minimumDecimal = minimum == null ? null : new BigDecimal(minimum);
    BigDecimal maximumDecimal = maximum == null ? null : new BigDecimal(maximum);
    return new ColumnStatistics(numberOfValues, 9L, null, null, null, null, null, new DecimalStatistics(minimumDecimal, maximumDecimal, SHORT_DECIMAL_VALUE_BYTES), null, null);
}
Also used : ColumnStatistics(io.prestosql.orc.metadata.statistics.ColumnStatistics) DecimalStatistics(io.prestosql.orc.metadata.statistics.DecimalStatistics) BigDecimal(java.math.BigDecimal)

Aggregations

DecimalStatistics (io.prestosql.orc.metadata.statistics.DecimalStatistics)2 BigDecimal (java.math.BigDecimal)2 ColumnStatistics (io.prestosql.orc.metadata.statistics.ColumnStatistics)1