static StatisticsClassException create(Statistics<?> stats1, Statistics<?> stats2) { if (stats1.getClass() != stats2.getClass()) { return new StatisticsClassException(stats1.getClass().toString(), stats2.getClass().toString()); } return new StatisticsClassException( "Statistics comparator mismatched: " + stats1.comparator() + " vs. " + stats2.comparator()); } }
/** * Method to merge this statistics object with the object passed * as parameter. Merging keeps the smallest of min values, largest of max * values and combines the number of null counts. * @param stats Statistics object to merge with */ public void mergeStatistics(Statistics stats) { if (stats.isEmpty()) return; // Merge stats only if they have the same type if (type.equals(stats.type)) { incrementNumNulls(stats.getNumNulls()); if (stats.hasNonNullValue()) { mergeStatisticsMinMax(stats); markAsNotEmpty(); } } else { throw StatisticsClassException.create(this, stats); } }
/** * Method to merge this statistics object with the object passed * as parameter. Merging keeps the smallest of min values, largest of max * values and combines the number of null counts. * @param stats Statistics object to merge with */ public void mergeStatistics(Statistics stats) { if (stats.isEmpty()) return; // Merge stats only if they have the same type if (type.equals(stats.type)) { incrementNumNulls(stats.getNumNulls()); if (stats.hasNonNullValue()) { mergeStatisticsMinMax(stats); markAsNotEmpty(); } } else { throw StatisticsClassException.create(this, stats); } }
static StatisticsClassException create(Statistics<?> stats1, Statistics<?> stats2) { if (stats1.getClass() != stats2.getClass()) { return new StatisticsClassException(stats1.getClass().toString(), stats2.getClass().toString()); } return new StatisticsClassException( "Statistics comparator mismatched: " + stats1.comparator() + " vs. " + stats2.comparator()); } }