private static FloatStatistics floatColumnStats(float minimum, float maximum) { FloatStatistics statistics = new FloatStatistics(); statistics.setMinMax(minimum, maximum); return statistics; }
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 void mergeStatisticsMinMax(Statistics stats) { FloatStatistics floatStats = (FloatStatistics)stats; if (!this.hasNonNullValue()) { initializeStats(floatStats.getMin(), floatStats.getMax()); } else { updateStats(floatStats.getMin(), floatStats.getMax()); } }
@Override public void updateStats(float value) { if (!this.hasNonNullValue()) { initializeStats(value, value); } else { updateStats(value, value); } }
@Override public String toString() { if (this.hasNonNullValue()) return String.format("min: %.5f, max: %.5f, num_nulls: %d", min, max, this.getNumNulls()); else if (!this.isEmpty()) return String.format("num_nulls: %d, min/max not defined", this.getNumNulls()); else return "no stats for this column"; }
/** * Returns the typed statistics object based on the passed type parameter * @param type PrimitiveTypeName type of the column * @return instance of a typed statistics class */ public static Statistics getStatsBasedOnType(PrimitiveTypeName type) { switch(type) { case INT32: return new IntStatistics(); case INT64: return new LongStatistics(); case FLOAT: return new FloatStatistics(); case DOUBLE: return new DoubleStatistics(); case BOOLEAN: return new BooleanStatistics(); case BINARY: return new BinaryStatistics(); case INT96: return new BinaryStatistics(); case FIXED_LEN_BYTE_ARRAY: return new BinaryStatistics(); default: throw new UnknownColumnTypeException(type); } }
FloatStatistics floatStatistics = (FloatStatistics) statistics; if (floatStatistics.genericGetMin() > floatStatistics.genericGetMax()) { return Domain.create(ValueSet.all(type), hasNullValue); parquetDoubleStatistics = new ParquetDoubleStatistics((double) floatStatistics.getMin(), (double) floatStatistics.getMax());
private static FloatStatistics floatColumnStats(float minimum, float maximum) { FloatStatistics statistics = new FloatStatistics(); statistics.setMinMax(minimum, maximum); return statistics; }