Repository navigation
Answer the call that leaves an argument to its NULL default on the typed SQL surfaces - #166
Merged
estebanzimanyi merged 1 commit intoOct 10, 2026
Conversation
…ped SQL surfaces A call leaving an argument declared DEFAULT NULL out passes what the wrapper passes for it, the catalog's nullDefaultBinds. _null_default_signatures of tools/codegen_jvm.py derives, for each shorter call of a signature, the signature without the NULL-default arguments the call leaves out and with the values the catalog states for the parameters they feed; a literal default keeps its place, and a NULL one the catalog states no value for ends the shorter calls. _sql_overloads yields the overload of each, and _default_variants, which both engines share, answers with it the call of that arity alone, the prefix PostgreSQL accepts, never the call without a NULL-default argument but with the literal one after it. The typed Flink and Spark surfaces register tintSeqSetGaps(tint[]) and tintSeqSetGaps(tint[], interval), tfloatSeq(tfloat), raquetRead(text) and the other shorter calls. The Spark UDF arm hides an argument left to a NULL default with the value the catalog states, raquetRead passing the quadbin 0 that Raquet_read passes. Witness: over MobilityDB 647acbe4ed both typed surfaces refuse every call leaving a NULL-default argument out, MobilitySpark failing on "function tintSeqSetGaps(array<tint>, interval day) does not exist". Measured over MobilityDB 647acbe4ed with the catalog of MEOS-API catalog/null-default-binds: both typed surfaces register 1163 SQL functions and 8931 overloads, against 8877 with main's generator, the 54 added being shorter calls of 51 SQL names and none removed; the Spark UDF surface and its gaps ledger are those of main's generator. Over the catalog of MEOS-API master 8818c0014d the generated sources equal those of main's generator. MobilitySpark passes its 37 tests with an assertion that tintSeqSetGaps over three instants with a three-day gap answers 2 sequences with a one-day maxt and 1 with none, and that tfloatSeq of an instant answers a sequence; it fails on them with main's generator. Why: a call SQL accepts answers on both engines as PostgreSQL answers it.
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 call leaving an argument declared DEFAULT NULL out passes what the wrapper passes for it, the
catalog's nullDefaultBinds. _null_default_signatures of tools/codegen_jvm.py derives, for each
shorter call of a signature, the signature without the NULL-default arguments the call leaves
out and with the values the catalog states for the parameters they feed; a literal default
keeps its place, and a NULL one the catalog states no value for ends the shorter calls.
_sql_overloads yields the overload of each, and _default_variants, which both engines share,
answers with it the call of that arity alone, the prefix PostgreSQL accepts, never the call
without a NULL-default argument but with the literal one after it. The typed Flink and Spark
surfaces register tintSeqSetGaps(tint[]) and tintSeqSetGaps(tint[], interval),
tfloatSeq(tfloat), raquetRead(text) and the other shorter calls. The Spark UDF arm hides an
argument left to a NULL default with the value the catalog states, raquetRead passing the
quadbin 0 that Raquet_read passes.
Witness: over MobilityDB 647acbe4ed both typed surfaces refuse every call leaving a NULL-default
argument out, MobilitySpark failing on "function tintSeqSetGaps(array, interval day) does
not exist".
Measured over MobilityDB 647acbe4ed with the catalog of MEOS-API catalog/null-default-binds:
both typed surfaces register 1163 SQL functions and 8931 overloads, against 8877 with main's
generator, the 54 added being shorter calls of 51 SQL names and none removed; the Spark UDF
surface and its gaps ledger are those of main's generator. Over the catalog of MEOS-API master
8818c0014d the generated sources equal those of main's generator. MobilitySpark passes its 37
tests with an assertion that tintSeqSetGaps over three instants with a three-day gap answers 2
sequences with a one-day maxt and 1 with none, and that tfloatSeq of an instant answers a
sequence; it fails on them with main's generator.
Why: a call SQL accepts answers on both engines as PostgreSQL answers it.