You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/blockhash/LongTopNBlockHash.java
+38-7Lines changed: 38 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,13 @@ public final class LongTopNBlockHash extends BlockHash {
38
38
privatefinalintlimit;
39
39
privatefinalLongHashhash;
40
40
privatefinalTreeSet<Long> topValues;
41
+
/**
42
+
* Helper field to keep track of the last top value.
43
+
* <p>
44
+
* Used temporarily as TreeSet#last() is O(log(n)) and would slow every insertion.
45
+
* </p>
46
+
*/
47
+
privatelonglastTopValue;
41
48
42
49
/**
43
50
* Have we seen any {@code null} values?
@@ -57,6 +64,7 @@ public LongTopNBlockHash(int channel, boolean asc, boolean nullsFirst, int limit
0 commit comments