Class LongBytesRefAdaptiveBlockHash

java.lang.Object
org.elasticsearch.compute.aggregation.blockhash.BlockHash
org.elasticsearch.compute.aggregation.blockhash.LongBytesRefAdaptiveBlockHash
All Implemented Interfaces:
Closeable, AutoCloseable, SeenGroupIds, Releasable

public final class LongBytesRefAdaptiveBlockHash extends BlockHash
An AdaptiveBlockHash for the two-key (LONG, BYTES_REF) (or (BYTES_REF, LONG)) grouping shape. As long as both inputs arrive as vectors, it routes through a dictionary-aware fast path: BytesRefBlockHash hashes the bytes column once (so for an OrdinalBytesRefVector it pays per dictionary entry, not per row), and a LongLongHashTable combines (bytesRefOrd, longKey) into a stable group id. As soon as a page brings a non-vector key column (i.e. nulls or multivalues are possible), it migrates to a PackedValuesBlockHash — which has correct null/MV semantics — and replays existing groups so ordinals stay stable.

Modeled after LongIntAdaptiveBlockHash. The migration encoding is variable-width because the BYTES_REF column has no fixed size; everything else is the same.