Repository navigation
State what a wrapper passes for an argument left to its NULL default - #185
Merged
estebanzimanyi merged 1 commit intoOct 10, 2026
Merged
Conversation
A SQL signature states in nullDefaultBinds, for each argument declared DEFAULT NULL, what its wrapper passes the MEOS function when the call leaves that argument out, which PostgreSQL passes as NULL: tintSeqSetGaps(tint[], maxt interval DEFAULT NULL, maxdist float DEFAULT NULL) passes maxt NULL and maxdist -1.0, tcbufferSeq(tcbuffer, text DEFAULT NULL) passes the interpolation INTERP_NONE, raquetRead(text, quadbin DEFAULT NULL) passes the quadbin 0. attach_null_default_binds of parser/boundargs.py reads each value from the wrapper: the literal a local starts from and replaces only under PG_NARGS() > k (#_guarded_default), the interpolation of the signature's temporal type it takes when the call carries no k (#_type_choice), or the literal of `x = PG_ARGISNULL(k) ? literal : ...`; it states a position only when every parameter the argument feeds (#_caller_index) has one, and only on a signature whose CREATE FUNCTION is not STRICT, since a STRICT one answers NULL without calling the wrapper. _create_fn_stmts of parser/sqlfn.py reports the strictness of a statement on request, which _wrapper_sql_strict keys as #_signature_wrapper matches a signature. Witness: on MEOS-API master 8818c00 over MobilityDB master 647acbe4ed the catalog states argDefaults NULL for 74 signatures and nothing of what their wrappers pass for them, so a binding either refuses the shorter call, as the typed Spark and Flink surfaces of JMEOS refuse tintSeqSetGaps(tint[], interval), or passes the default of the C type, as the Spark UDF of raquetRead passes 0 for a quadbin by coincidence. Measured over MobilityDB master 647acbe4ed: run.py states 92 positions over 71 signatures (the 17 <type>SeqSetGaps, the 33 one-argument <type>Seq and <type>SeqSet forms, 19 of appendInstantTransition and the 2 raquetRead), every value the one its wrapper passes; the 3 left (raquet, clip, reclass) fill a NULL argument through statements the rules do not read; every other key of every function equals that of master's parser. The suite passes 525 tests with none skipped, among them the two of tests/test_boundargs.py NullDefaultBindTests. Why: a call leaving an argument to its default answers as PostgreSQL does only when the binding passes what the wrapper passes, and that value is the catalog's to state.
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 signature states in nullDefaultBinds, for each argument declared DEFAULT NULL, what its
wrapper passes the MEOS function when the call leaves that argument out, which PostgreSQL passes
as NULL: tintSeqSetGaps(tint[], maxt interval DEFAULT NULL, maxdist float DEFAULT NULL) passes
maxt NULL and maxdist -1.0, tcbufferSeq(tcbuffer, text DEFAULT NULL) passes the interpolation
INTERP_NONE, raquetRead(text, quadbin DEFAULT NULL) passes the quadbin 0.
attach_null_default_binds of parser/boundargs.py reads each value from the wrapper: the literal a
local starts from and replaces only under PG_NARGS() > k (#_guarded_default), the interpolation
of the signature's temporal type it takes when the call carries no k (#_type_choice), or the
literal of
x = PG_ARGISNULL(k) ? literal : ...; it states a position only when every parameterthe argument feeds (#_caller_index) has one, and only on a signature whose CREATE FUNCTION is not
STRICT, since a STRICT one answers NULL without calling the wrapper. _create_fn_stmts of
parser/sqlfn.py reports the strictness of a statement on request, which _wrapper_sql_strict
keys as #_signature_wrapper matches a signature.
Witness: on MEOS-API master 8818c00 over MobilityDB master 647acbe4ed the catalog states
argDefaults NULL for 74 signatures and nothing of what their wrappers pass for them, so a binding
either refuses the shorter call, as the typed Spark and Flink surfaces of JMEOS refuse
tintSeqSetGaps(tint[], interval), or passes the default of the C type, as the Spark UDF of
raquetRead passes 0 for a quadbin by coincidence.
Measured over MobilityDB master 647acbe4ed: run.py states 92 positions over 71 signatures (the
17 SeqSetGaps, the 33 one-argument Seq and SeqSet forms, 19 of
appendInstantTransition and the 2 raquetRead), every value the one its wrapper passes; the 3 left
(raquet, clip, reclass) fill a NULL argument through statements the rules do not read; every other
key of every function equals that of master's parser. The suite passes 525 tests with none
skipped, among them the two of tests/test_boundargs.py NullDefaultBindTests.
Why: a call leaving an argument to its default answers as PostgreSQL does only when the binding
passes what the wrapper passes, and that value is the catalog's to state.