Skip to content

State on each SQL signature the name a Spark or Flink binding publishes - #173

Merged
estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:catalog/alt-sql-name
Oct 4, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:catalog/alt-sql-name

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

A PostgreSQL wrapper states, beside its SQL name, the name a binding publishes where its engine
owns the PostgreSQL one: @sqlfn round() and @altsqlfn floatRound(), geoRound(), ... on
Set_round. The catalog carries that name on each SQL signature, altSqlName, read from the tags of
the wrapper backing it, so a Spark or Flink generator registers the function under it rather than
under a name its engine defines or reserves.

A tag lists one name or several, every name() from the tag to the next tag, as @csqlfn is read. A
wrapper with several @sqlfn names pairs each with the alternative name in its position, as @sqlop
pairs with @sqlfn: Tgeo_rotate_z, behind rotateZ and rotate, gives geoRotateZ and geoRotate. A
wrapper stating one alternative name gives it to every signature. A wrapper listing several under
one @sqlfn name gives each signature the name whose prefix names the base type of its first
argument: the type of that name (cbuffer, pose), the base whose set type it prefixes (int for
intset, float for floatset) or the members of the class predicate _basetype of
meos_catalog.c (geo for geometry and geography). The base type of a temporal argument is the value
it answers at an instant, the return type of its startValue, so trgeometry, the concatenation of a
reference geometry and a temporal pose, takes geoRound; a set, span or span set reaches its base
through the type registry, and an array through its element type. A signature selecting no name or
several stops the catalog.

Measured over MobilityDB master f9c15d092a, the catalog derived from the installed headers of
a libmeos built by tools/provision-meos.sh, as the provision-meos action derives it: 808 catalog
signatures state an alternative name, 513 distinct SQL signatures by name and first argument
type, each with one name. They are the 477 the @altsqlfn tags of MobilityDB #2948 reach, each
with the name families 1 to 5 and 7 to 9 of the portable naming plan give it (floatRound over
tfloat, geoRound over tgeompoint and trgeometry, intAbs over tint, spanLower over the spans,
temporalHash over the temporal types, setUnnest over the sets), and the 36 set constructors
taking setMake. The suite passes its 485 tests over that catalog, tests/test_altsqlfn.py and
its contract tests included, and the 8 engine integration tests pass against that libmeos.

Why: the name a binding publishes is a fact about the SQL function, stated once on its wrapper,
so every generator reads it from the catalog rather than from a list kept in each binding.

A PostgreSQL wrapper states, beside its SQL name, the name a binding publishes where its engine
owns the PostgreSQL one: @sqlfn round() and @altsqlfn floatRound(), geoRound(), ... on
Set_round. The catalog carries that name on each SQL signature, altSqlName, read from the tags of
the wrapper backing it, so a Spark or Flink generator registers the function under it rather than
under a name its engine defines or reserves.

A tag lists one name or several, every name() from the tag to the next tag, as @csqlfn is read. A
wrapper with several @sqlfn names pairs each with the alternative name in its position, as @sqlop
pairs with @sqlfn: Tgeo_rotate_z, behind rotateZ and rotate, gives geoRotateZ and geoRotate. A
wrapper stating one alternative name gives it to every signature. A wrapper listing several under
one @sqlfn name gives each signature the name whose prefix names the base type of its first
argument: the type of that name (cbuffer, pose), the base whose set type it prefixes (int for
intset, float for floatset) or the members of the class predicate <prefix>_basetype of
meos_catalog.c (geo for geometry and geography). The base type of a temporal argument is the value
it answers at an instant, the return type of its startValue, so trgeometry, the concatenation of a
reference geometry and a temporal pose, takes geoRound; a set, span or span set reaches its base
through the type registry, and an array through its element type. A signature selecting no name or
several stops the catalog.

Measured over MobilityDB master f9c15d092a, the catalog derived from the installed headers of
a libmeos built by tools/provision-meos.sh, as the provision-meos action derives it: 808 catalog
signatures state an alternative name, 513 distinct SQL signatures by name and first argument
type, each with one name. They are the 477 the @altsqlfn tags of MobilityDB #2948 reach, each
with the name families 1 to 5 and 7 to 9 of the portable naming plan give it (floatRound over
tfloat, geoRound over tgeompoint and trgeometry, intAbs over tint, spanLower over the spans,
temporalHash over the temporal types, setUnnest over the sets), and the 36 set constructors
taking setMake. The suite passes its 485 tests over that catalog, tests/test_altsqlfn.py and
its contract tests included, and the 8 engine integration tests pass against that libmeos.

Why: the name a binding publishes is a fact about the SQL function, stated once on its wrapper,
so every generator reads it from the catalog rather than from a list kept in each binding.
@estebanzimanyi
estebanzimanyi merged commit e384b86 into MobilityDB:master Oct 4, 2026
3 checks passed
@estebanzimanyi
estebanzimanyi deleted the catalog/alt-sql-name branch October 4, 2026 11:24
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