Apache Solr open-source search software
SOLR-10918: Fix IntPointField hashing for HLL (#1137)
Houston Putman282fb99e1481
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 4216fd755d0..28d82a816a8 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -80,6 +80,8 @@ Bug Fixes* SOLR-16477: Collection RENAME api creates broken alias (Alex Deparvu via Kevin Risden)+* SOLR-10918: Fix IntPointField hashing for HLL (Houston Putman)+Build---------------------* Upgrade forbiddenapis to 3.4 (Uwe Schindler)diff --git a/solr/core/src/java/org/apache/solr/handler/component/SortedNumericStatsValues.java b/solr/core/src/java/org/apache/solr/handler/component/SortedNumericStatsValues.javaindex ed090f2bd9b..67d41861d83 100644--- a/solr/core/src/java/org/apache/solr/handler/component/SortedNumericStatsValues.java+++ b/solr/core/src/java/org/apache/solr/handler/component/SortedNumericStatsValues.java@@ -58,6 +58,8 @@ public class SortedNumericStatsValues implements StatsValues {private Number toCorrectType(long value) {switch (numberType) {case INTEGER:+ return (int) value;+ case DATE:case LONG:return value;case FLOAT:diff --git a/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java b/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.javaindex 25542df1234..a17c51879f3 100644--- a/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java+++ b/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java@@ -157,18 +157,14 @@ public class TestDistributedStatsComponentCardinality extends BaseDistributedSeaMap<String, FieldStatsInfo> stats = rsp.getFieldStatsInfo();- if (Boolean.getBoolean(NUMERIC_POINTS_SYSPROP)) {- // SOLR-10918: can't rely on exact match with pre-hashed values when using points- } else {- for (String f : STAT_FIELDS) {- // regardless of log2m and regwidth, the estimated cardinality of the- // hashed vs prehashed values should be exactly the same for each field-- assertEquals(- f + ": hashed vs prehashed, real=" + numMatches + ", p=" + p,- stats.get(f).getCardinality().longValue(),- stats.get(f + "_prehashed_l").getCardinality().longValue());- }+ for (String f : STAT_FIELDS) {+ // regardless of log2m and regwidth, the estimated cardinality of the+ // hashed vs prehashed values should be exactly the same for each field++ assertEquals(+ f + ": hashed vs prehashed, real=" + numMatches + ", p=" + p,+ stats.get(f).getCardinality().longValue(),+ stats.get(f + "_prehashed_l").getCardinality().longValue());}for (String f : STAT_FIELDS) {