File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
core/src/main/java/io/questdb/cairo/map Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 3030import io .questdb .cairo .sql .RecordCursor ;
3131import io .questdb .std .Decimal128 ;
3232import io .questdb .std .Decimal256 ;
33+ import io .questdb .std .Hash ;
3334import io .questdb .std .IntList ;
3435import io .questdb .std .Long256 ;
3536import io .questdb .std .Long256Impl ;
@@ -327,7 +328,10 @@ public MapValue getValue() {
327328
328329 @ Override
329330 public long keyHashCode () {
330- return 0 ; // no-op
331+ // Although this map does not use hash codes, this method is implemented
332+ // for the purpose of map sharding, i.e. to spread keys among multiple Unordered2Maps
333+ // in case when group by functions, such as count_distinct(), have high cardinality.
334+ return Hash .hashShort64 (Unsafe .getUnsafe ().getShort (startAddress ));
331335 }
332336
333337 public void of (long address ) {
You can’t perform that action at this time.
0 commit comments