Skip to main content

Module aggregatehashtable

Module aggregatehashtable 

Source
Expand description

Auto-extracted from physical_operator.rs

Structs§

AggregateHashTable
A parallel hash table for aggregation with GROUP BY keys.

Functions§

build_group_key
Build a composite group key from chunk columns.
hash_group_key
Hash group key columns directly from Arrow arrays without creating intermediate Value objects. For strings, avoids the to_string() allocation that get_value() would incur. For primitives, avoids Value enum dispatch overhead.
keys_equal
Check if a stored group key matches the current row’s group column values. Avoids creating Value::List or intermediate Value objects for comparison.
resolve_agg_col_indices
Resolve aggregate function argument expressions to column indices. Returns one Option per function: None means no column needed (e.g., COUNT(*)).
resolve_group_by_indices
Resolve GROUP BY expressions to actual column indices using field_names.
update_states_row
Update aggregate states for a single row.
update_states_row_distinct
Update aggregate states for a single row, honoring per-function DISTINCT flags (P88, COUNT(DISTINCT x) → name COUNT_DISTINCT + this flag). For DISTINCT functions, NULLs and argument values already seen for this (group, function) are skipped, so the state only ever accumulates distinct non-null values. Seen-values use a linear Vec<Value> scan — fine for the rarity of DISTINCT aggregates; dedicated fast paths cover the common cases.