@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 IntStatistics copy() { return new IntStatistics(this); } }
private IntStatistics(IntStatistics other) { super(other.type()); if (other.hasNonNullValue()) { initializeStats(other.min, other.max); } setNumNulls(other.getNumNulls()); }
@Override public void updateStats(int value) { if (!this.hasNonNullValue()) { initializeStats(value, value); } else { updateStats(value, value); } }
public static Statistics convertDateStatIfNecessary(Statistics stat, ParquetReaderUtility.DateCorruptionStatus containsCorruptDates) { IntStatistics dateStat = (IntStatistics) stat; LongStatistics dateMLS = new LongStatistics(); boolean isDateCorrect = containsCorruptDates == ParquetReaderUtility.DateCorruptionStatus.META_SHOWS_NO_CORRUPTION; // Only do conversion when stat is NOT empty. if (!dateStat.isEmpty()) { dateMLS.setMinMax( convertToDrillDateValue(dateStat.getMin(), isDateCorrect), convertToDrillDateValue(dateStat.getMax(), isDateCorrect)); dateMLS.setNumNulls(dateStat.getNumNulls()); } return dateMLS; }
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; } }
public void initializeStats(int min_value, int max_value) { min = min_value; max = max_value; this.markAsNotEmpty(); }
public void updateStats(int min_value, int max_value) { if (comparator().compare(min, min_value) > 0) { min = min_value; } if (comparator().compare(max, max_value) < 0) { max = max_value; } }
return (statistics.hasNonNullValue() && statistics.compareMaxToValue(ParquetReaderUtility.DATE_CORRUPTION_THRESHOLD) > 0) ? DateCorruptionStatus.META_SHOWS_CORRUPTION : DateCorruptionStatus.META_UNCLEAR_TEST_VALUES;
@Override public boolean isSmallerThan(long size) { return !hasNonNullValue() || (8 < size); }
@SuppressWarnings("unchecked") private Statistics<T> getStatistics(int min, int max) { final Statistics<T> statistics = Statistics.getStatsBasedOnType(PrimitiveType.PrimitiveTypeName.INT32); ((IntStatistics) statistics).setMinMax(min, max); return statistics; }
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);
@Override public void updateStats(int value) { if (!this.hasNonNullValue()) { initializeStats(value, value); } else { updateStats(value, value); } }
public void setMinMax(int min, int max) { this.max = max; this.min = min; this.markAsNotEmpty(); }
public void updateStats(int min_value, int 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); }
case INT : case TIME: ((IntStatistics) stat).setMinMax(Integer.parseInt(min.toString()), Integer.parseInt(max.toString())); break; case BIGINT:
@Override public void mergeStatisticsMinMax(Statistics stats) { IntStatistics intStats = (IntStatistics)stats; if (!this.hasNonNullValue()) { initializeStats(intStats.getMin(), intStats.getMax()); } else { updateStats(intStats.getMin(), intStats.getMax()); } }