Skip to content

Pass a bound NULL to a parameter of any reference type on the typed SQL surfaces - #165

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:codegen/bound-null-for-any-reference
Oct 9, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:codegen/bound-null-for-any-reference

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

A parameter the catalog binds to NULL receives the Java literal null whatever its reference type,
a jnr.ffi.Pointer or a java.lang.String alike, and is refused only for the eight primitive types,
which hold no null. _bound_literal decides it for both typed SQL surfaces.

Witness: over MobilityDB master a0480a7d38 and MEOS-API master f8f63bd the catalog binds srs of
temporal_as_mfjson to NULL, as the PostgreSQL wrapper derives it from the value and MEOS names the
reference system from spatial_ref_sys.csv when it is NULL; the jar types the parameter, a
const char *, as java.lang.String, and main renders NULL only for jnr.ffi.Pointer, so both
engines refuse the 20 asMFJSON signatures as bound:NULL/java.lang.String and register no asMFJSON.

Measured over the same pair with the jar built from that catalog and that libmeos: no signature
is refused for a bound NULL where main refuses 20, and the 121 refused for their argument count
are unchanged; spark-sql and flink-sql each register 1155 SQL functions and 8829 overloads where
main registers 1154 and 8754, the generated trees differing from main's only by AsMFJSON.java and
its registration. The spark engine generates the same tree as main, and mvn clean install runs
106 codegen and 1800 jmeos-core tests green with no warning.

Why: asMFJSON on Spark and Flink names the reference system as MEOS does for every binding, from
its own reference systems.

…QL surfaces

A parameter the catalog binds to NULL receives the Java literal null whatever its reference type,
a jnr.ffi.Pointer or a java.lang.String alike, and is refused only for the eight primitive types,
which hold no null. _bound_literal decides it for both typed SQL surfaces.

Witness: over MobilityDB master a0480a7d38 and MEOS-API master f8f63bd the catalog binds srs of
temporal_as_mfjson to NULL, as the PostgreSQL wrapper derives it from the value and MEOS names the
reference system from spatial_ref_sys.csv when it is NULL; the jar types the parameter, a
const char *, as java.lang.String, and main renders NULL only for jnr.ffi.Pointer, so both
engines refuse the 20 asMFJSON signatures as bound:NULL/java.lang.String and register no asMFJSON.

Measured over the same pair with the jar built from that catalog and that libmeos: no signature
is refused for a bound NULL where main refuses 20, and the 121 refused for their argument count
are unchanged; spark-sql and flink-sql each register 1155 SQL functions and 8829 overloads where
main registers 1154 and 8754, the generated trees differing from main's only by AsMFJSON.java and
its registration. The spark engine generates the same tree as main, and mvn clean install runs
106 codegen and 1800 jmeos-core tests green with no warning.

Why: asMFJSON on Spark and Flink names the reference system as MEOS does for every binding, from
its own reference systems.
@estebanzimanyi
estebanzimanyi merged commit ab0ea0e into MobilityDB:main Oct 9, 2026
2 checks passed
@estebanzimanyi
estebanzimanyi deleted the codegen/bound-null-for-any-reference branch October 9, 2026 21:35
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