Skip to content

Answer the call that leaves an argument to its NULL default on the typed SQL surfaces - #166

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:codegen/null-default-arities
Oct 10, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:codegen/null-default-arities

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

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.

…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.
@estebanzimanyi
estebanzimanyi merged commit 6154b8d into MobilityDB:main Oct 10, 2026
2 checks passed
@estebanzimanyi
estebanzimanyi deleted the codegen/null-default-arities branch October 10, 2026 05:48
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