risingwave_common::hash::dispatcher

Function calc_hash_key_kind

source
pub fn calc_hash_key_kind(data_types: &[DataType]) -> HashKeyKind
Expand description

Calculate what kind of hash key should be used given the key data types.

When any of following conditions is met, we choose crate::hash::SerializedKey:

  1. Has variable size column.
  2. Number of columns exceeds MAX_FIXED_SIZE_KEY_ELEMENTS
  3. Sizes of data types exceed 256 bytes.
  4. Any column’s serialized format can’t be used for equality check.

Otherwise we choose smallest crate::hash::FixedSizeKey whose size can hold all data types.