@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; }
@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; }
@SuppressWarnings("unchecked") private Statistics<T> getStatistics(boolean min, boolean max) { Statistics<T> statistics = Statistics.getStatsBasedOnType(PrimitiveType.PrimitiveTypeName.BOOLEAN); ((BooleanStatistics) statistics).setMinMax(min, max); return statistics; }
@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 mergeStatisticsMinMax(Statistics stats) { DoubleStatistics doubleStats = (DoubleStatistics)stats; if (!this.hasNonNullValue()) { initializeStats(doubleStats.getMin(), doubleStats.getMax()); } else { updateStats(doubleStats.getMin(), doubleStats.getMax()); } }
private IntStatistics(IntStatistics other) { super(other.type()); if (other.hasNonNullValue()) { initializeStats(other.min, other.max); } setNumNulls(other.getNumNulls()); }
private BinaryStatistics(BinaryStatistics other) { super(other.type()); if (other.hasNonNullValue()) { initializeStats(other.min, other.max); } setNumNulls(other.getNumNulls()); }
/** * Returns the string representation of min for debugging/logging purposes. * * @return the min value as a string */ public String minAsString() { return stringify(genericGetMin()); }
private BooleanStatistics(BooleanStatistics other) { super(other.type()); if (other.hasNonNullValue()) { initializeStats(other.min, other.max); } setNumNulls(other.getNumNulls()); }
@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; }
@Override public void updateStats(boolean value) { if (!this.hasNonNullValue()) { initializeStats(value, value); } else { updateStats(value, value); } }
@Override public void updateStats(Binary value) { if (!this.hasNonNullValue()) { initializeStats(value, value); } else { updateStats(value, value); } }
@SuppressWarnings("unchecked") private Statistics<T> getStatistics(long min, long max) { final Statistics statistics = Statistics.getStatsBasedOnType(PrimitiveType.PrimitiveTypeName.INT64); ((LongStatistics) statistics).setMinMax(min, max); return statistics; }
@Override public BinaryStatistics copy() { return new BinaryStatistics(this); } }
@Override public DoubleStatistics copy() { return new DoubleStatistics(this); } }
public void setMinMax(double min, double max) { this.max = max; this.min = min; this.markAsNotEmpty(); }
public void initializeStats(int min_value, int max_value) { min = min_value; max = max_value; this.markAsNotEmpty(); }
public void setMinMax(float min, float max) { this.max = max; this.min = min; this.markAsNotEmpty(); }
public void setMinMax(long min, long max) { this.max = max; this.min = min; this.markAsNotEmpty(); }
@Override public void mergeStatisticsMinMax(Statistics stats) { DoubleStatistics doubleStats = (DoubleStatistics)stats; if (!this.hasNonNullValue()) { initializeStats(doubleStats.getMin(), doubleStats.getMax()); } else { updateStats(doubleStats.getMin(), doubleStats.getMax()); } }