feat: JMEOS 1.3 + BerlinMOD portable SQL + binary roundtrip protocol#4
Open
estebanzimanyi wants to merge 1 commit intoMobilityDB:mainfrom
Open
feat: JMEOS 1.3 + BerlinMOD portable SQL + binary roundtrip protocol#4estebanzimanyi wants to merge 1 commit intoMobilityDB:mainfrom
estebanzimanyi wants to merge 1 commit intoMobilityDB:mainfrom
Conversation
eec0530 to
2566ffc
Compare
b338693 to
c07a2af
Compare
…uck/MobilitySpark
Extends the BerlinMOD cross-platform POC (RFC #861 portable dialect) from 6
queries to 9 (Q1–Q8 + QRT), adding the full temporal-restriction, trajectory,
and region-intersection query set.
New queries:
Q2 eIntersects(trip, region) — region intersection filter
Q7 atTime(trip, tstzspan) — period restriction (binary output via asHexWKB)
Q8 trajectory(trip) — spatial path as hex WKB geometry
QRT already existed; Q3/Q7 confirmed byte-identical cross-platform
API corrections:
- Remove atPeriod alias (old pre-1.0 name); Q7 uses atTime(trip, tstzspan)
- atTime UDF is now a unified (String, String) dispatcher:
"[…]" prefix → tstzspan_in + temporal_at_tstzspan (Q7 period path)
otherwise → pg_timestamptz_in + temporal_at_timestamptz (Q3 instant path,
Spark implicitly casts TIMESTAMP column → STRING)
- trajectory UDF returns geo_as_hexewkb (not geo_as_ewkt) so the geometry
binary matches PostgreSQL COPY and DuckDB COPY output byte-for-byte
New UDFs (TemporalUDFs):
startTimestamp, endTimestamp, numInstants, speed, atGeometry
New UDFs (GeoUDFs):
eContains, trajectory (hex-WKB)
New data files:
berlinmod/data/query_regions.csv — polygon region for Q2
berlinmod/data/query_periods.csv — tstzspan period for Q7
New runner:
berlinmod/run_mspark.sh — three-runner story complete
All 9 queries verified ALL PASS on MobilityDB (run_mbdb.sh).
c07a2af to
b17c0a4
Compare
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.
Summary
atTime,eIntersects,nearestApproachDistance,eDwithin,tgeompoint(WKT→hex-WKB),geomFromText.sqlfiles run unchanged on MobilityDB (PostgreSQL), MobilityDuck (DuckDB), and MobilitySpark (Apache Spark)ashexewkb(val)UDF serialises temporal values to MEOS hex-WKB — the same C function (temporal_as_hexwkb, variant 0, NDR) called by MobilityDB/MobilityDuck. Text in (WKT CSV), binary out (hex-WKB), byte-level equality tested across all three platformsashexewkb(atTime(trip, instant))produces identical bytes on all three platformsexpected/qrt.csvgenerated from MobilityDB as ground truth; byte equality confirmedberlinmod/: dataset CSV files,expected/for Q1/Q3/Q4/Q5/Q6/QRT,run_mbdb.sh(MobilityDB, locally verified 6/6 PASS),run_mduck.sh(MobilityDuck runner)libmeos.sofrom JMEOS jar, setLD_LIBRARY_PATH; 15 unit tests passgeo_from_text()Byte-equality claim
The key correctness property: JMEOS calls
temporal_as_hexwkb(ptr, 0)(MEOS C function); MobilityDB SQL callsashexewkb(tgeompoint)(same C function). TheasHexEWKB_matches_mbdb_expectedunit test asserts byte-for-byte equality against the known MobilityDB output for trip 1.Test plan
asHexEWKBtests)run_mbdb.sh: Q1/Q3/Q4/Q5/Q6 + QRT — 6/6 PASS againstexpected/on MobilityDB locallyrun_mduck.sh: Q1/Q3/Q4/Q5/Q6 + QRT — needs MobilityDuck CLI to verifyspark-submit BerlinMODDemo berlinmod/data berlinmod/expected— needs Spark environment🤖 Generated with Claude Code