Generate aggregate identity from the @csqlaggfn tag#55
Merged
estebanzimanyi merged 1 commit intoJul 15, 2026
Merged
Conversation
Read @csqlaggfn from meos/src so each transition/combine/final function records the SQL aggregate role it implements in a new `sqlAgg` catalog field. This gives an aggregate member its own identity (setUnionTransition, spanUnionFinal) distinct from the identically named binary set/span union function, so a binding can reconstruct the standard PostgreSQL aggregate model rather than guess from name suffixes. The tag is one hop: the #Name() references are the SQL aggregate-role names directly, with no wrapper indirection to resolve. A member shared by two aggregates (spanset_union_finalfn) carries a list of names, recorded verbatim.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The catalog resolves a function's SQL name from
@sqlfn/@csqlfn, but an aggregate member (a transition/combine/final function) has no way to record which SQL aggregate it belongs to. Its SQL-facing name collides with the identically named binary set/span union function, so a binding cannot tellint_union_transfn(asetUnionmember) apart from thesetUnion(int)scalar function and has to guess the aggregate structure from name suffixes.This reads the
@csqlaggfntag frommeos/srcand attaches a newsqlAggfield naming the SQL aggregate role(s) each member implements:int_union_transfn→["setUnionTransition"]set_union_finalfn→["setUnionFinal"]span_union_transfn→["spanUnionTransition"]spanset_union_finalfn→["spanUnionFinal", "spansetUnionFinal"](one member shared by two aggregates)The tag is one hop: the
#Name()references are the SQL aggregate-role names directly, with no wrapper indirection to resolve, so the extractor mirrors_meos_to_mdbminus the second_mdb_to_sqlhop. Names are recorded verbatim — a faithful reader, no derivation.Depends on the corresponding
@csqlaggfnsource tags in MobilityDB (MobilityDB/MobilityDB#1411); the field attaches once those tags are present in the scanned source.