if (intStatistics.genericGetMin() > intStatistics.genericGetMax()) { failWithCorruptionException(failOnCorruptedParquetStatistics, column, id, intStatistics); return Domain.create(ValueSet.all(type), hasNullValue); parquetIntegerStatistics = new ParquetIntegerStatistics((long) intStatistics.getMin(), (long) intStatistics.getMax()); if (intStatistics.genericGetMin() > intStatistics.genericGetMax()) { failWithCorruptionException(failOnCorruptedParquetStatistics, column, id, intStatistics); return Domain.create(ValueSet.all(type), hasNullValue); ParquetIntegerStatistics parquetIntegerStatistics = new ParquetIntegerStatistics((long) intStatistics.getMin(), (long) intStatistics.getMax()); return createDomain(type, hasNullValue, parquetIntegerStatistics);
private static IntStatistics intColumnStats(int minimum, int maximum) { IntStatistics statistics = new IntStatistics(); statistics.setMinMax(minimum, maximum); return statistics; } }
@Override public void mergeStatisticsMinMax(Statistics stats) { IntStatistics intStats = (IntStatistics)stats; if (!this.hasNonNullValue()) { initializeStats(intStats.getMin(), intStats.getMax()); } else { updateStats(intStats.getMin(), intStats.getMax()); } }
@Override public void updateStats(int value) { if (!this.hasNonNullValue()) { initializeStats(value, value); } else { updateStats(value, value); } }
@Override public String toString() { if (this.hasNonNullValue()) return String.format("min: %d, max: %d, num_nulls: %d", min, max, this.getNumNulls()); else if (!this.isEmpty()) return String.format("num_nulls: %d, min/max is 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); } }
IntStatistics intStatistics = (IntStatistics) statistics; if (intStatistics.genericGetMin() > intStatistics.genericGetMax()) { return Domain.create(ValueSet.all(type), hasNullValue); parquetIntegerStatistics = new ParquetIntegerStatistics((long) intStatistics.getMin(), (long) intStatistics.getMax());
private static IntStatistics intColumnStats(int minimum, int maximum) { IntStatistics statistics = new IntStatistics(); statistics.setMinMax(minimum, maximum); return statistics; } }