@Override public DoubleStatistics copy() { return new DoubleStatistics(this); } }
@Override public void mergeStatisticsMinMax(Statistics stats) { DoubleStatistics doubleStats = (DoubleStatistics)stats; if (!this.hasNonNullValue()) { initializeStats(doubleStats.getMin(), doubleStats.getMax()); } else { updateStats(doubleStats.getMin(), doubleStats.getMax()); } }
private DoubleStatistics(DoubleStatistics other) { super(other.type()); if (other.hasNonNullValue()) { initializeStats(other.min, other.max); } setNumNulls(other.getNumNulls()); }
@Override public void updateStats(double value) { if (!this.hasNonNullValue()) { initializeStats(value, value); } else { updateStats(value, value); } }
@Override public Statistics<?> build() { DoubleStatistics stats = (DoubleStatistics) super.build(); if (stats.hasNonNullValue()) { Double min = stats.genericGetMin(); Double max = stats.genericGetMax(); // Drop min/max values in case of NaN as the sorting order of values is undefined for this case if (min.isNaN() || max.isNaN()) { stats.setMinMax(0.0, 0.0); ((Statistics<?>) stats).hasNonNullValue = false; } else { // Updating min to -0.0 and max to +0.0 to ensure that no 0.0 values would be skipped if (Double.compare(min, 0.0) == 0) { min = -0.0; stats.setMinMax(min, max); } if (Double.compare(max, -0.0) == 0) { max = 0.0; stats.setMinMax(min, max); } } } return stats; } }
private static DoubleStatistics doubleColumnStats(double minimum, double maximum) { DoubleStatistics statistics = new DoubleStatistics(); statistics.setMinMax(minimum, maximum); return statistics; }
if (doubleStatistics.genericGetMin() > doubleStatistics.genericGetMax()) { failWithCorruptionException(failOnCorruptedParquetStatistics, column, id, doubleStatistics); return Domain.create(ValueSet.all(type), hasNullValue); ParquetDoubleStatistics parquetDoubleStatistics = new ParquetDoubleStatistics(doubleStatistics.genericGetMin(), doubleStatistics.genericGetMax()); return createDomain(type, hasNullValue, parquetDoubleStatistics);
@SuppressWarnings("unchecked") private Statistics<T> getStatistics(double min, double max) { final Statistics<T> statistics = Statistics.getStatsBasedOnType(PrimitiveType.PrimitiveTypeName.DOUBLE); ((DoubleStatistics) statistics).setMinMax(min, max); return statistics; }
public void updateStats(double min_value, double max_value) { if (comparator().compare(min, min_value) > 0) { min = min_value; } if (comparator().compare(max, max_value) < 0) { max = max_value; } }
@Override public boolean isSmallerThan(long size) { return !hasNonNullValue() || (16 < size); }
@Override public Statistics<?> build() { DoubleStatistics stats = (DoubleStatistics) super.build(); if (stats.hasNonNullValue()) { Double min = stats.genericGetMin(); Double max = stats.genericGetMax(); // Drop min/max values in case of NaN as the sorting order of values is undefined for this case if (min.isNaN() || max.isNaN()) { stats.setMinMax(0.0, 0.0); ((Statistics<?>) stats).hasNonNullValue = false; } else { // Updating min to -0.0 and max to +0.0 to ensure that no 0.0 values would be skipped if (Double.compare(min, 0.0) == 0) { min = -0.0; stats.setMinMax(min, max); } if (Double.compare(max, -0.0) == 0) { max = 0.0; stats.setMinMax(min, max); } } } return stats; } }
@Override public void updateStats(double value) { if (!this.hasNonNullValue()) { initializeStats(value, value); } else { updateStats(value, value); } }
if (doubleStatistics.genericGetMin() > doubleStatistics.genericGetMax()) { failWithCorruptionException(failOnCorruptedParquetStatistics, column, id, doubleStatistics); return Domain.create(ValueSet.all(type), hasNullValue); ParquetDoubleStatistics parquetDoubleStatistics = new ParquetDoubleStatistics(doubleStatistics.genericGetMin(), doubleStatistics.genericGetMax()); return createDomain(type, hasNullValue, parquetDoubleStatistics);
break; case FLOAT8: ((DoubleStatistics) stat).setMinMax(Double.parseDouble(min.toString()), Double.parseDouble(max.toString())); break; case DATE:
public void updateStats(double min_value, double max_value) { if (comparator().compare(min, min_value) > 0) { min = min_value; } if (comparator().compare(max, max_value) < 0) { max = max_value; } }
@Override public boolean isSmallerThan(long size) { return !hasNonNullValue() || (16 < size); }
@Override public void mergeStatisticsMinMax(Statistics stats) { DoubleStatistics doubleStats = (DoubleStatistics)stats; if (!this.hasNonNullValue()) { initializeStats(doubleStats.getMin(), doubleStats.getMax()); } else { updateStats(doubleStats.getMin(), doubleStats.getMax()); } }
private DoubleStatistics(DoubleStatistics other) { super(other.type()); if (other.hasNonNullValue()) { initializeStats(other.min, other.max); } setNumNulls(other.getNumNulls()); }
@Override public DoubleStatistics copy() { return new DoubleStatistics(this); } }