Skip to content

Drop the unnecessary *Agg suffix from non-colliding aggregates#133

Open
estebanzimanyi wants to merge 1 commit into
fix/bump-meos-pinfrom
feat/drop-agg-suffix
Open

Drop the unnecessary *Agg suffix from non-colliding aggregates#133
estebanzimanyi wants to merge 1 commit into
fix/bump-meos-pinfrom
feat/drop-agg-suffix

Conversation

@estebanzimanyi
Copy link
Copy Markdown
Member

@estebanzimanyi estebanzimanyi commented May 13, 2026

DuckDB's catalog dispatches on argument types, so the same-stem collision that previously motivated the *Agg suffix (RFC #827, e.g. aggregate Tmin on tnumber vs scalar Tmin on tbox) is resolved by signature dispatch: the aggregate takes a temporal value, the scalar takes a box, they coexist. The suffix read as ugly and broke the principle that the cross-platform SQL form should match what a Snowflake/Databricks/lakehouse programmer would naturally write. All 21 aggregates and their test references are renamed (TandAgg to Tand, TminAgg to Tmin, MergeAgg to Merge, WavgAgg to Wavg, etc.); doc comments in src/temporal/temporal_aggregates.cpp and the four affected parity test headers replace the *Agg-convention prose with the simpler argument-type-dispatch explanation. Pure rename plus doc cleanup, no semantic change. CI is currently blocked by an unrelated pre-existing vcpkg/MEOS pin issue on origin/main: portfile REF f11b7443e (pre-Apr-28 meosType to MeosType rename) does not match SHA512 ae8589acc8 (which corresponds to 742c1fb5, post-rename), so fresh downloads compile-fail at src/include/tydef.hpp:18 with "MeosType does not name a type"; a separate vcpkg-pin-fix PR is the right vehicle since fully bumping MEOS cascades into per-call signature updates beyond this rename scope.

@estebanzimanyi estebanzimanyi force-pushed the feat/drop-agg-suffix branch 2 times, most recently from 6d36d04 to ebd5ede Compare May 14, 2026 06:32
@estebanzimanyi
Copy link
Copy Markdown
Member Author

Reviewer's quickstart — ~2-3 minutes

What this PR does: Drop the *Agg suffix from all aggregate names.

Risk: focused, single-purpose. Spot-check the source diff + matching tests; CI confirms.

Cross-link: Linux arm64 CI here needs #161 for the orthogonal MeosType build error.

@estebanzimanyi estebanzimanyi changed the base branch from main to fix/bump-meos-pin May 30, 2026 07:58
@estebanzimanyi estebanzimanyi force-pushed the feat/drop-agg-suffix branch 2 times, most recently from ff0817a to e0363d6 Compare May 30, 2026 09:08
@estebanzimanyi
Copy link
Copy Markdown
Member Author

Aggregates whose bare name collides with a scalar must keep a disambiguating suffix: DuckDB maps a function name to a single catalog entry kind, so registering an aggregate over the existing scalar time-min/max accessors (Tmin/Tmax on tbox/stbox) fails extension load with 'GetAlterInfo not implemented'. The aggregate surface registers TminAgg/TmaxAgg (and the rest of the *Agg set) for this reason.

@estebanzimanyi
Copy link
Copy Markdown
Member Author

Reopening: the *Agg suffix is a binding-surface workaround that breaks the ecosystem auto-codegen (all bindings are mechanical remaps of the canonical MEOS name). The tmin/tmax scalar-accessor vs temporal-aggregate name collision is resolved at the MEOS/canonical level so every binding inherits the same distinct names, not by suffixing in DuckDB alone.

@estebanzimanyi
Copy link
Copy Markdown
Member Author

Superseded by MobilityDB #828 (green): the scalar/aggregate name collisions are resolved canonically at the MEOS surface by suffixing the aggregate form (mergeAgg/appendInstantAgg/appendSequenceAgg/minDistanceAgg/tminAgg/tmaxAgg), which every binding inherits via codegen. MobilityDuck already registers TminAgg/TmaxAgg, so it conforms; dropping the suffix would re-introduce the load collision.

@estebanzimanyi estebanzimanyi changed the title Drop the *Agg suffix from all aggregate names Drop the unnecessary *Agg suffix from non-colliding aggregates May 30, 2026
@estebanzimanyi estebanzimanyi force-pushed the feat/drop-agg-suffix branch from e0363d6 to d003ef2 Compare May 30, 2026 15:05
@estebanzimanyi estebanzimanyi force-pushed the fix/bump-meos-pin branch 4 times, most recently from fa2de57 to 17588c0 Compare June 2, 2026 09:47
@estebanzimanyi estebanzimanyi force-pushed the feat/drop-agg-suffix branch from d003ef2 to 2779530 Compare June 5, 2026 15:32
@estebanzimanyi estebanzimanyi force-pushed the feat/drop-agg-suffix branch from 2779530 to e0f1a3b Compare June 5, 2026 17:15
@estebanzimanyi estebanzimanyi force-pushed the feat/drop-agg-suffix branch from e0f1a3b to 13f7a38 Compare June 5, 2026 18:42
@estebanzimanyi estebanzimanyi force-pushed the feat/drop-agg-suffix branch from 13f7a38 to 26fda1f Compare June 6, 2026 04:38
@estebanzimanyi estebanzimanyi force-pushed the feat/drop-agg-suffix branch 3 times, most recently from eeefcdd to ba3e7f6 Compare June 6, 2026 07:15
Keep the Agg suffix only on aggregates whose name collides with a scalar of
the same name (TminAgg/TmaxAgg vs the box time-bound accessors; MergeAgg,
AppendInstantAgg, AppendSequenceAgg vs their scalar forms). The non-colliding
aggregates (Tand, Tor, Tcount, Tsum, Tavg, Tcentroid, Wcount, Wsum, Wavg,
Wmin, Wmax, SetUnion, SpanUnion) take the bare canonical name.
@estebanzimanyi estebanzimanyi force-pushed the feat/drop-agg-suffix branch from ba3e7f6 to f2b2d0d Compare June 6, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant