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);
}
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);
}
Aggregations