Skip to content

Pass the model of the earth MEOS measures a geography on - #162

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:codegen/pass-spheroid
Oct 9, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:codegen/pass-spheroid

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

The MEOS functions measuring a temporal geo take a last bool spheroid, read for geographies only.
The classes of jmeos-core (TPoint length, cumulative_length, speed, the ever and temporal
dwithin, the temporal distance, the nearest approach distance and instant and the shortest line,
the STBox nearest approach distances, the Frechet, dynamic time warping and Hausdorff distances
of Temporal) pass true, the DEFAULT of the SQL argument, so each answers on the spheroid as it
did.

The generators carry it through the array kernels and the set-returning functions. The NxN
kernels take a bool beside their distance: codegen_spark_udfs.py reads it as a Boolean argument,
and the folded form of the MeosOps facade as a boolean. A UDF registered under a SQL name takes
the arguments the SQL signature requires (sqlArity) and passes the value MobilityDB gives the
flags it omits, as emit_single does: minDistance, eDwithinPairs, aDwithinPairs and tDwithinPairs
over arrays, and dynTimeWarpPath and frechetPath, take their arguments without spheroid and pass
true, while the C-named UDFs take spheroid.

Witness: over MobilityDB 8a9bc20b62, where #3005 adds spheroid, and MEOS-API c6f423d2ef, main
fails to compile: "method nad_stbox_stbox in class functions.GeneratedFunctions cannot be
applied to given types; required: jnr.ffi.Pointer,jnr.ffi.Pointer,boolean", 25 calls in
TPoint, STBox and Temporal. With the jar built, the Spark gaps step refuses
adwithin_tgeoarr_tgeoarr, edwithin_tgeoarr_tgeoarr, mindistance_tgeoarr_tgeoarr and
tdwithin_tgeoarr_tgeoarr, the facade emits no aDwithinPairs, eDwithinPairs or tDwithinPairs,
and MobilitySpark's GeneratedSurfaceTest fails on "The dynTimeWarpPath requires 3 parameters
but the actual number is 2".

Measured over the same pair: mvn clean install passes 106 codegen and 1800 core tests, none
skipped, with no warning; the Spark surface registers 13 NxN UDFs where main registers 10, the
same 53 C-named and 12 SQL-named set-returning UDFs, and the gaps step reports none new; the
facade emits the three folded forms with their spheroid; the typed flink-sql and spark-sql
surfaces each register 1154 SQL functions and 8749 overloads, as with main's generator. With
this jar and these generators MobilitySpark main passes its 35 tests, and MobilityFlink, its
benchmark passing spheroid as fix/pass-spheroid does, its 21 binding and 12 benchmark tests.

Why: a binding passes every argument of the MEOS function it calls, a SQL name answers the call
SQL accepts, and a measure keeps the model of the earth its caller had.

The MEOS functions measuring a temporal geo take a last bool spheroid, read for geographies only.
The classes of jmeos-core (TPoint length, cumulative_length, speed, the ever and temporal
dwithin, the temporal distance, the nearest approach distance and instant and the shortest line,
the STBox nearest approach distances, the Frechet, dynamic time warping and Hausdorff distances
of Temporal) pass true, the DEFAULT of the SQL argument, so each answers on the spheroid as it
did.

The generators carry it through the array kernels and the set-returning functions. The NxN
kernels take a bool beside their distance: codegen_spark_udfs.py reads it as a Boolean argument,
and the folded form of the MeosOps facade as a boolean. A UDF registered under a SQL name takes
the arguments the SQL signature requires (sqlArity) and passes the value MobilityDB gives the
flags it omits, as emit_single does: minDistance, eDwithinPairs, aDwithinPairs and tDwithinPairs
over arrays, and dynTimeWarpPath and frechetPath, take their arguments without spheroid and pass
true, while the C-named UDFs take spheroid.

Witness: over MobilityDB 8a9bc20b62, where #3005 adds spheroid, and MEOS-API c6f423d2ef, main
fails to compile: "method nad_stbox_stbox in class functions.GeneratedFunctions cannot be
applied to given types; required: jnr.ffi.Pointer,jnr.ffi.Pointer,boolean", 25 calls in
TPoint, STBox and Temporal. With the jar built, the Spark gaps step refuses
adwithin_tgeoarr_tgeoarr, edwithin_tgeoarr_tgeoarr, mindistance_tgeoarr_tgeoarr and
tdwithin_tgeoarr_tgeoarr, the facade emits no aDwithinPairs, eDwithinPairs or tDwithinPairs,
and MobilitySpark's GeneratedSurfaceTest fails on "The `dynTimeWarpPath` requires 3 parameters
but the actual number is 2".

Measured over the same pair: mvn clean install passes 106 codegen and 1800 core tests, none
skipped, with no warning; the Spark surface registers 13 NxN UDFs where main registers 10, the
same 53 C-named and 12 SQL-named set-returning UDFs, and the gaps step reports none new; the
facade emits the three folded forms with their spheroid; the typed flink-sql and spark-sql
surfaces each register 1154 SQL functions and 8749 overloads, as with main's generator. With
this jar and these generators MobilitySpark main passes its 35 tests, and MobilityFlink, its
benchmark passing spheroid as fix/pass-spheroid does, its 21 binding and 12 benchmark tests.

Why: a binding passes every argument of the MEOS function it calls, a SQL name answers the call
SQL accepts, and a measure keeps the model of the earth its caller had.
@estebanzimanyi
estebanzimanyi merged commit 79f6bc5 into MobilityDB:main Oct 9, 2026
2 checks passed
@estebanzimanyi
estebanzimanyi deleted the codegen/pass-spheroid branch October 9, 2026 14:29
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