Generate the Flink SQL surface in the binding module (stacked on #63) - #65
Merged
estebanzimanyi merged 3 commits intoSep 12, 2026
Merged
Conversation
The MeosOps* facades are grouped by the catalog's object model, which gives a class to every base value MEOS passes by reference: geom_in belongs to Geometry, the cbuffer, npoint and pose constructors and accessors to Cbuffer, Npoint and Pose, geo_as_text to Geo. The smoke tests call those methods on the free-function classes, MeosOpsFreeGeo, MeosOpsFreeCbuffer, MeosOpsFreeNpoint and MeosOpsFreePose, which hold none of them, so the binding module's tests do not compile against facades generated from the current catalog. Each call names the class that holds the method, in both the binding and the benchmark copies. The wiring javadoc and README name methods the same way and are checked against the same facades: overlaps_tbox_tbox is on MeosOpsFreeCore, edwithin_tgeo_tgeo on MeosOpsFreeGeo, tbox_in on MeosOpsTBox, and the windowed-tier examples use tpoint_length and tnumber_twavg, the MEOS functions for a trajectory's length and a temporal number's time-weighted average.
The binding module generates the MobilityDB SQL surface for Flink SQL beside the MeosOps facades: a second generate-sources execution runs codegen_jvm.py --engine flink-sql over the same staged catalog and JMEOS jar into target/generated-sql, and MobilityFlinkSql.registerAll registers every function under its MobilityDB SQL name. The module takes flink-table-api-java for the function and type classes, and the planner for its tests. GeneratedSqlSurfaceTest runs the surface end to end on a Flink mini-cluster against libmeos: accessors, overloads resolved by argument type, timestamps and intervals crossing as Flink TIMESTAMP_LTZ and INTERVAL values, constructors from Flink scalars, text input and output, a name Flink reserves called quoted, a name Flink has a built-in for resolving to the built-in unless qualified, and MEOS values grouped across a shuffle. The CI floor rises to the 27 tests the suite holds, and GENERATION.md describes the surface. Built with tools/refresh-from-master.sh against MobilityDB master 31aa65124a and a JMEOS jar carrying the flink-sql engine, mvn clean test runs 27 tests, 15 in the binding module (8 of them GeneratedSqlSurfaceTest) and 12 in the benchmark, none failing or skipped.
The generated Flink SQL surface passes a SQL array to a MEOS function taking a C array. The test builds an intset and a tstzset from arrays of Flink scalars, measures minDistance between arrays of tgeompoint values against the closed-form distances 5 and 1, and expects a null element to raise. GENERATION.md states how an array crosses the surface, and the suite floor rises to 28.
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.
Name every facade method by the class the catalog puts it in
The MeosOps* facades are grouped by the catalog's object model, which gives a
class to every base value MEOS passes by reference: geom_in belongs to
Geometry, the cbuffer, npoint and pose constructors and accessors to Cbuffer,
Npoint and Pose, geo_as_text to Geo. The smoke tests call those methods on the
free-function classes, MeosOpsFreeGeo, MeosOpsFreeCbuffer, MeosOpsFreeNpoint and
MeosOpsFreePose, which hold none of them, so the binding module's tests do not
compile against facades generated from the current catalog. Each call names
the class that holds the method, in both the binding and the benchmark copies.
The wiring javadoc and README name methods the same way and are checked against
the same facades: overlaps_tbox_tbox is on MeosOpsFreeCore, edwithin_tgeo_tgeo
on MeosOpsFreeGeo, tbox_in on MeosOpsTBox, and the windowed-tier examples use
tpoint_length and tnumber_twavg, the MEOS functions for a trajectory's length
and a temporal number's time-weighted average.
Generate the Flink SQL surface in the binding module
The binding module generates the MobilityDB SQL surface for Flink SQL beside
the MeosOps facades: a second generate-sources execution runs
codegen_jvm.py --engine flink-sql over the same staged catalog and JMEOS jar
into target/generated-sql, and MobilityFlinkSql.registerAll registers every
function under its MobilityDB SQL name. The module takes flink-table-api-java
for the function and type classes, and the planner for its tests.
GeneratedSqlSurfaceTest runs the surface end to end on a Flink mini-cluster
against libmeos: accessors, overloads resolved by argument type, timestamps and
intervals crossing as Flink TIMESTAMP_LTZ and INTERVAL values, constructors
from Flink scalars, text input and output, a name Flink reserves called quoted,
a name Flink has a built-in for resolving to the built-in unless qualified, and
MEOS values grouped across a shuffle. The CI floor rises to the 27 tests the
suite holds, and GENERATION.md describes the surface.
Built with tools/refresh-from-master.sh against MobilityDB master 31aa65124a
and a JMEOS jar carrying the flink-sql engine, mvn clean test runs 27 tests,
15 in the binding module (8 of them GeneratedSqlSurfaceTest) and 12 in the
benchmark, none failing or skipped.
Test the arrays the generated SQL surface takes
The generated Flink SQL surface passes a SQL array to a MEOS function
taking a C array. The test builds an intset and a tstzset from arrays of
Flink scalars, measures minDistance between arrays of tgeompoint values
against the closed-form distances 5 and 1, and expects a null element to
raise. GENERATION.md states how an array crosses the surface, and the
suite floor rises to 28.