From eeed3c461d36708c7f1de57702b3c4c106c2ba42 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Fri, 9 Oct 2026 16:57:37 +0200 Subject: [PATCH] Pass the MF-JSON option MEOS takes for the bounding box temporal_as_mfjson takes the option of the SQL function asMFJSON in place of a flag for the bounding box: the sum of 1 for the bounding box, 2 for the short name of the coordinate reference system and 4 for its long name. Temporal.as_mfjson keeps its arguments and passes 1 when with_bbox is true and 0 otherwise, the options 0 and 1 asMFJSON states, so the system is named as MEOS names it by default; the parity test of the generated asMFJSON gives it the option 1 on both sides. Witness: over MobilityDB 2a1d52a7ee, where e63fc3f7d8 changes the parameter, and MEOS-API e84319b325, main fails to compile: "Temporal.java:[163,65] incompatible types: boolean cannot be converted to int", which fails the JMEOS jar step of MobilityFlink #72. Measured over the same pair: mvn clean install passes 106 codegen and 1800 core tests, none skipped, with no warning; the Spark gaps step reports none new; the typed flink-sql and spark-sql surfaces each register 1154 SQL functions and 8747 overloads. Why: a binding passes every argument of the MEOS function it calls in the type MEOS states, and a method of the class keeps the answer its callers had. --- jmeos-core/src/main/java/types/temporal/Temporal.java | 2 +- .../types/temporal/generated/GeneratedTemporalParityTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jmeos-core/src/main/java/types/temporal/Temporal.java b/jmeos-core/src/main/java/types/temporal/Temporal.java index dc642ba67..3d14c2617 100644 --- a/jmeos-core/src/main/java/types/temporal/Temporal.java +++ b/jmeos-core/src/main/java/types/temporal/Temporal.java @@ -160,7 +160,7 @@ public byte[] as_wkb(){ * @return The temporal object as a MF-JSON string. */ public String as_mfjson(boolean with_bbox, int flags, int precision, String srs){ - return GeneratedFunctions.temporal_as_mfjson(this.inner,with_bbox,flags,precision,srs); + return GeneratedFunctions.temporal_as_mfjson(this.inner, with_bbox ? 1 : 0, flags, precision, srs); } diff --git a/jmeos-core/src/test/java/types/temporal/generated/GeneratedTemporalParityTest.java b/jmeos-core/src/test/java/types/temporal/generated/GeneratedTemporalParityTest.java index 3f7a46360..c830535e1 100644 --- a/jmeos-core/src/test/java/types/temporal/generated/GeneratedTemporalParityTest.java +++ b/jmeos-core/src/test/java/types/temporal/generated/GeneratedTemporalParityTest.java @@ -294,8 +294,8 @@ void outputMatchesTheLibrary() { // The hex-WKB and MF-JSON strings match the direct call; the size_out is folded by the wrapper. assertEquals(GeneratedFunctions.temporal_as_hexwkb(p, (byte) 4), g.asHEXWKB((byte) 4)); - assertEquals(GeneratedFunctions.temporal_as_mfjson(p, true, 3, 6, null), - g.asMFJSON(true, 3, 6, null)); + assertEquals(GeneratedFunctions.temporal_as_mfjson(p, 1, 3, 6, null), + g.asMFJSON(1, 3, 6, null)); // The WKB buffer is returned as a raw pointer. assertNotNull(g.asWKB((byte) 4)); }