State the arguments a forwarding SQL function passes twice - #152
Open
estebanzimanyi wants to merge 1 commit into
Open
estebanzimanyi wants to merge 1 commit into
estebanzimanyi wants to merge 1 commit into
Conversation
A SQL function with no C symbol whose body forwards its arguments to one
C-backed signature, repeating one of them or passing a literal in place of
one, is a signature of the wrapper behind the signature it calls.
spaceSplit(tgeompoint, xsize, sorigin, bitmatrix, borderInc) is the body
SELECT spaceSplit($1, $2, $2, $2, $3, $4, $5): it is a signature of
Tgeo_space_split, and tgeo_space_split states it with
repeatedArgs: {ysize: xsize, zsize: xsize}, keyed by the C parameter the
repeat fills and valued by the C parameter the first occurrence fills, as
boundArgs keys a literal. stops(tgeompoint, minduration) is
SELECT stops($1, 0.0, $2), stated with boundArgs: {maxdist: 0.0} on its own
signature.
The signature called is the one of that name whose argument count admits
the call, defaults included, and whose argument at each position a $k fills
has the type of argument k, float8 meeting float. The arguments of a
signature fill in order the C parameters that are neither out-parameters nor
bound by the wrapper, so the argument passed at position i fills the i-th of
them. A call two signatures fit, or a function whose inputs do not line up
with the arguments of its signature, stops the catalog. A body computing an
argument, a cast or a call, is a composition and adds no signature.
Why. A binding registers one function per SQL signature and calls MEOS from
the arguments it receives. The forwarding functions are the forms a user
calls with one size for a cubic grid, and the catalog stated none of them:
their CREATE FUNCTION names no C symbol.
Measured. Over MobilityDB 8a23781e4c, 13 functions gain 39 signatures: 32
repeat an argument (spaceSplit, spaceTimeSplit, spaceBoxes, spaceTimeBoxes,
spaceTiles, spaceTimeTiles, getSpaceTile, getSpaceTimeTile), stating 48
repeatedArgs entries, and 7 pass a literal (stops, translate, scale), taking
the bound literals from 1826 to 1833. The sqlArity of 12 of them drops by
the sizes the one- and two-size forms omit. The 16 forwards over tpose and
tpcpoint call a signature that is itself a composition and add none. The
catalog is otherwise identical to the one derived without the change, and
its OpenAPI projection validates.
Witness. tests/test_sqlfn_forward.py reads a repeat and a literal as a
forward and a cast, a call, a reordering, a dropped or an unchanged argument
as none, attaches a forward to the wrapper of the signature it calls through
the type spellings, adds none for a forward calling a composition, stops on
a call two signatures fit and on inputs not lining up, and states
repeatedArgs and the forward's own boundArgs through merge_boundargs. The
suite floor goes from 337 to 352.
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 SQL function with no C symbol whose body forwards its arguments to one
C-backed signature, repeating one of them or passing a literal in place of
one, is a signature of the wrapper behind the signature it calls.
spaceSplit(tgeompoint, xsize, sorigin, bitmatrix, borderInc) is the body
SELECT spaceSplit($1, $2, $2, $2, $3, $4, $5): it is a signature of
Tgeo_space_split, and tgeo_space_split states it with
repeatedArgs: {ysize: xsize, zsize: xsize}, keyed by the C parameter the
repeat fills and valued by the C parameter the first occurrence fills, as
boundArgs keys a literal. stops(tgeompoint, minduration) is
SELECT stops($1, 0.0, $2), stated with boundArgs: {maxdist: 0.0} on its own
signature.
The signature called is the one of that name whose argument count admits
the call, defaults included, and whose argument at each position a $k fills
has the type of argument k, float8 meeting float. The arguments of a
signature fill in order the C parameters that are neither out-parameters nor
bound by the wrapper, so the argument passed at position i fills the i-th of
them. A call two signatures fit, or a function whose inputs do not line up
with the arguments of its signature, stops the catalog. A body computing an
argument, a cast or a call, is a composition and adds no signature.
Why. A binding registers one function per SQL signature and calls MEOS from
the arguments it receives. The forwarding functions are the forms a user
calls with one size for a cubic grid, and the catalog stated none of them:
their CREATE FUNCTION names no C symbol.
Measured. Over MobilityDB 8a23781e4c, 13 functions gain 39 signatures: 32
repeat an argument (spaceSplit, spaceTimeSplit, spaceBoxes, spaceTimeBoxes,
spaceTiles, spaceTimeTiles, getSpaceTile, getSpaceTimeTile), stating 48
repeatedArgs entries, and 7 pass a literal (stops, translate, scale), taking
the bound literals from 1826 to 1833. The sqlArity of 12 of them drops by
the sizes the one- and two-size forms omit. The 16 forwards over tpose and
tpcpoint call a signature that is itself a composition and add none. The
catalog is otherwise identical to the one derived without the change, and
its OpenAPI projection validates.
Witness. tests/test_sqlfn_forward.py reads a repeat and a literal as a
forward and a cast, a call, a reordering, a dropped or an unchanged argument
as none, attaches a forward to the wrapper of the signature it calls through
the type spellings, adds none for a forward calling a composition, stops on
a call two signatures fit and on inputs not lining up, and states
repeatedArgs and the forward's own boundArgs through merge_boundargs. The
suite floor goes from 337 to 352.