State on each SQL signature the name a Spark or Flink binding publishes - #173
Merged
estebanzimanyi merged 1 commit intoOct 4, 2026
Merged
Conversation
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.
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.
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.