Repository navigation
State the name another engine calls an aggregate by - #196
Merged
estebanzimanyi merged 1 commit intoOct 16, 2026
Merged
estebanzimanyi merged 1 commit into
estebanzimanyi merged 1 commit into
Conversation
An aggregate whose PostgreSQL name a function also holds cannot take that name in DuckDB, Spark or Flink, which hold one function per name: those engines call tAnd the aggregate tAndAgg. MobilityDB states that name where it states every other engine's name, in @altsqlfn, on the transition wrapper of the aggregate beside its @sqlaggfn, a transition serving one aggregate: @sqlfn tAndTransition() @sqlaggfn tAnd() @altsqlfn tAndAgg() There @altsqlfn names the aggregate, never the transition: wrapper_names leaves out a wrapper stating @sqlaggfn, so no transition signature takes an altSqlName, and attach_aggregate_alt_sql_names, run after attach_aggregates, pairs the tag with the @sqlaggfn names by position and sets altSqlName on every entry of the aggregates section of that aggregate. A wrapper whose two lists differ in length, or an aggregate two wrappers name differently, stops the catalog, as an unresolved function alternative does. Witness: over the MobilityDB branch sql/aggregates-keep-their-names, whose transition wrappers state @altsqlfn (Tbool_tand_transfn: tAndAgg), master's parser states an alternative name on 1018 function signatures against 864 over MobilityDB master: the 154 transition signatures take the aggregate's name as their own, and no aggregate entry takes it. Why: one tag and one field carry every name an engine takes in place of a PostgreSQL one, so the bindings read altSqlName for an aggregate as they do for a function, and need no rule of their own to append Agg. Measured: over that branch the catalog states altSqlName on 154 aggregate entries, the CREATE AGGREGATE count of the eleven aggregates whose name a function also holds, and on 864 function signatures, the count master's parser and this one both read over MobilityDB master 439dc9fbe3 (0 aggregate entries there, which carries no such tag); the test suite runs 558 tests, OK, the two new ones included.
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.
An aggregate whose PostgreSQL name a function also holds cannot take that
name in DuckDB, Spark or Flink, which hold one function per name: those
engines call tAnd the aggregate tAndAgg. MobilityDB states that name where
it states every other engine's name, in @altsqlfn, on the transition
wrapper of the aggregate beside its @sqlaggfn, a transition serving one
aggregate:
@sqlfn tAndTransition()
@sqlaggfn tAnd()
@altsqlfn tAndAgg()
There @altsqlfn names the aggregate, never the transition: wrapper_names
leaves out a wrapper stating @sqlaggfn, so no transition signature takes
an altSqlName, and attach_aggregate_alt_sql_names, run after
attach_aggregates, pairs the tag with the @sqlaggfn names by position and
sets altSqlName on every entry of the aggregates section of that
aggregate. A wrapper whose two lists differ in length, or an aggregate two
wrappers name differently, stops the catalog, as an unresolved function
alternative does.
Witness: over the MobilityDB branch sql/aggregates-keep-their-names, whose
transition wrappers state @altsqlfn (Tbool_tand_transfn: tAndAgg), master's
parser states an alternative name on 1018 function signatures against 864
over MobilityDB master: the 154 transition signatures take the aggregate's
name as their own, and no aggregate entry takes it.
Why: one tag and one field carry every name an engine takes in place of a
PostgreSQL one, so the bindings read altSqlName for an aggregate as they
do for a function, and need no rule of their own to append Agg.
Measured: over that branch the catalog states altSqlName on 154 aggregate
entries, the CREATE AGGREGATE count of the eleven aggregates whose name a
function also holds, and on 864 function signatures, the count master's
parser and this one both read over MobilityDB master 439dc9fbe3 (0
aggregate entries there, which carries no such tag); the test suite runs
558 tests, OK, the two new ones included.