1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// SPDX-License-Identifier: BUSL-1.1
//! Shared GROUP BY key naming rule.
//!
//! A computed (non-column) GROUP BY key needs one canonical name shared by the
//! planner spec (the name the Data-Plane executor emits the evaluated value
//! under) and the response shaper (the `lookup_key` it reads that value back
//! by). Deriving both from this single helper guarantees they can never
//! diverge — a mismatch would surface the key value as a NULL cell.
//!
//! The name is index-based (`group_{index}`), not the SELECT alias: it is a
//! purely internal executor↔shaper handshake. The alias only ever reaches the
//! shaper's `display_name`, derived separately from `SqlPlan::Aggregate`'s
//! `group_by_aliases`.
use SqlExpr;
/// The canonical internal name for a computed GROUP BY key: a stable
/// `group_{index}` placeholder. Used as both the executor output name and the
/// shaper lookup key for a non-column key.
pub
/// The output/lookup name for one GROUP BY key. A bare column keeps its own
/// (unqualified) column name so bare-column output stays byte-identical to the
/// string-keyed form; a computed expression uses [`computed_group_key_name`].
pub