risingwave_common::hash

Trait HashKey

source
pub trait HashKey:
    EstimateSize
    + Clone
    + Debug
    + Hash
    + Eq
    + Sized
    + Send
    + Sync
    + 'static {
    type Bitmap: NullBitmap;

    // Required methods
    fn build_many(column_indices: &[usize], data_chunk: &DataChunk) -> Vec<Self>;
    fn deserialize(&self, data_types: &[DataType]) -> ArrayResult<OwnedRow>;
    fn deserialize_to_builders(
        &self,
        array_builders: &mut [ArrayBuilderImpl],
        data_types: &[DataType],
    ) -> ArrayResult<()>;
    fn null_bitmap(&self) -> &Self::Bitmap;
}
Expand description

Trait for different kinds of hash keys.

Current comparison implementation treats null == null. This is consistent with postgresql’s group by implementation, but not join. In pg’s join implementation, null != null, and the join executor should take care of this.

Required Associated Types§

Required Methods§

source

fn build_many(column_indices: &[usize], data_chunk: &DataChunk) -> Vec<Self>

Build hash keys from the given data_chunk with column_indices in a batch.

source

fn deserialize(&self, data_types: &[DataType]) -> ArrayResult<OwnedRow>

Deserializes the hash key into a row.

source

fn deserialize_to_builders( &self, array_builders: &mut [ArrayBuilderImpl], data_types: &[DataType], ) -> ArrayResult<()>

Deserializes the hash key into array builders.

source

fn null_bitmap(&self) -> &Self::Bitmap

Get the null bitmap of the hash key.

Object Safety§

This trait is not object safe.

Implementors§