Struct tidb_query_executors::slow_hash_aggr_executor::SlowHashAggregationImpl[][src]

pub struct SlowHashAggregationImpl {
    states: Vec<Box<dyn AggrFunctionState>>,
    groups: HashMap<GroupKeyRefUnsafe, usize>,
    group_by_exps: Vec<RpnExpression>,
    extra_group_by_col_index: Vec<usize>,
    original_group_by_col_index: Vec<usize>,
    group_key_buffer: Box<Vec<u8>>,
    group_key_offsets: Vec<usize>,
    states_offset_each_logical_row: Vec<usize>,
    group_by_results_unsafe: Vec<RpnStackNode<'static>>,
    cached_encoded_result: Vec<Option<Vec<u8>>>,
}

Fields

states: Vec<Box<dyn AggrFunctionState>>groups: HashMap<GroupKeyRefUnsafe, usize>

The value is the group index. states and group_key_offsets are stored in the order of group index.

group_by_exps: Vec<RpnExpression>extra_group_by_col_index: Vec<usize>

Extra group by columns store the bytes columns in original data form while default columns store them in sortkey form. The sortkey form is used to aggr on while the original form is to be returned as results.

For example, the bytes column at index i will be stored in sortkey form at column i and in original data form at column extra_group_by_col_index[i].

original_group_by_col_index: Vec<usize>

The sequence of group by column index which are in original form and are in the same order as group_by_exps by substituting bytes columns index for extra group by column index.

group_key_buffer: Box<Vec<u8>>

Encoded group keys are stored in this buffer sequentially. Offsets of each encoded element are stored in group_key_offsets.

GroupKeyRefUnsafe contains a raw pointer to this buffer.

group_key_offsets: Vec<usize>

The offsets of encoded keys in group_key_buffer. This Vec always has a leading 0 element. Then, the begin and end offsets of the “i”-th column of the group key whose group index is “j” are group_key_offsets[j * group_by_col_len + i] and group_key_offsets[j * group_by_col_len + i + 1].

group_by_col_len = group_by_exps.len() + extra_group_by_col_index.len()

states_offset_each_logical_row: Vec<usize>group_by_results_unsafe: Vec<RpnStackNode<'static>>

Stores evaluation results of group by expressions. It is just used to reduce allocations. The lifetime is not really ’static. The elements are only valid in the same batch where they are added.

cached_encoded_result: Vec<Option<Vec<u8>>>

Cached encoded results for calculated Scalar results

Trait Implementations

impl<Src: BatchExecutor> AggregationExecutorImpl<Src> for SlowHashAggregationImpl[src]

fn is_partial_results_ready(&self) -> bool[src]

Slow hash aggregation can output aggregate results only if the source is drained.

impl Send for SlowHashAggregationImpl[src]

Auto Trait Implementations

impl !RefUnwindSafe for SlowHashAggregationImpl

impl !Sync for SlowHashAggregationImpl

impl Unpin for SlowHashAggregationImpl

impl !UnwindSafe for SlowHashAggregationImpl

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<V, W> ConvertFrom<W> for V where
    W: ConvertTo<V>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]