@Override public void mergeStatisticsMinMax(Statistics stats) { FloatStatistics floatStats = (FloatStatistics)stats; if (!this.hasNonNullValue()) { initializeStats(floatStats.getMin(), floatStats.getMax()); } else { updateStats(floatStats.getMin(), floatStats.getMax()); } }
@Override public FloatStatistics copy() { return new FloatStatistics(this); } }
private FloatStatistics(FloatStatistics other) { super(other.type()); if (other.hasNonNullValue()) { initializeStats(other.min, other.max); } setNumNulls(other.getNumNulls()); }
@Override public void updateStats(float value) { if (!this.hasNonNullValue()) { initializeStats(value, value); } else { updateStats(value, value); } }
if (floatStatistics.genericGetMin() > floatStatistics.genericGetMax()) { failWithCorruptionException(failOnCorruptedParquetStatistics, column, id, floatStatistics); return Domain.create(ValueSet.all(type), hasNullValue); (long) floatToRawIntBits(floatStatistics.getMin()), (long) floatToRawIntBits(floatStatistics.getMax()));
@Override public Statistics<?> build() { FloatStatistics stats = (FloatStatistics) super.build(); if (stats.hasNonNullValue()) { Float min = stats.genericGetMin(); Float 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.0f, 0.0f); ((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 (Float.compare(min, 0.0f) == 0) { min = -0.0f; stats.setMinMax(min, max); } if (Float.compare(max, -0.0f) == 0) { max = 0.0f; stats.setMinMax(min, max); } } } return stats; } }
private static FloatStatistics floatColumnStats(float minimum, float maximum) { FloatStatistics statistics = new FloatStatistics(); statistics.setMinMax(minimum, maximum); return statistics; }
@SuppressWarnings("unchecked") private Statistics<T> getStatistics(float min, float max) { final Statistics<T> statistics = Statistics.getStatsBasedOnType(PrimitiveType.PrimitiveTypeName.FLOAT); ((FloatStatistics) statistics).setMinMax(min, max); return statistics; }
public void updateStats(float min_value, float 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() || (8 < size); }
if (floatStatistics.genericGetMin() > floatStatistics.genericGetMax()) { failWithCorruptionException(failOnCorruptedParquetStatistics, column, id, floatStatistics); return Domain.create(ValueSet.all(type), hasNullValue); (long) floatToRawIntBits(floatStatistics.getMin()), (long) floatToRawIntBits(floatStatistics.getMax()));
@Override public Statistics<?> build() { FloatStatistics stats = (FloatStatistics) super.build(); if (stats.hasNonNullValue()) { Float min = stats.genericGetMin(); Float 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.0f, 0.0f); ((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 (Float.compare(min, 0.0f) == 0) { min = -0.0f; stats.setMinMax(min, max); } if (Float.compare(max, -0.0f) == 0) { max = 0.0f; stats.setMinMax(min, max); } } } return stats; } }
@Override public void updateStats(float value) { if (!this.hasNonNullValue()) { initializeStats(value, value); } else { updateStats(value, value); } }
break; case FLOAT4: ((FloatStatistics) stat).setMinMax(Float.parseFloat(min.toString()), Float.parseFloat(max.toString())); break; case FLOAT8:
public void updateStats(float min_value, float 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() || (8 < size); }
@Override public void mergeStatisticsMinMax(Statistics stats) { FloatStatistics floatStats = (FloatStatistics)stats; if (!this.hasNonNullValue()) { initializeStats(floatStats.getMin(), floatStats.getMax()); } else { updateStats(floatStats.getMin(), floatStats.getMax()); } }
private FloatStatistics(FloatStatistics other) { super(other.type()); if (other.hasNonNullValue()) { initializeStats(other.min, other.max); } setNumNulls(other.getNumNulls()); }
@Override public FloatStatistics copy() { return new FloatStatistics(this); } }