From d67e9f735aa2c8fc43ec7032ec9493c74bfaa582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Zim=C3=A1nyi?= Date: Sat, 10 Oct 2026 02:01:57 +0200 Subject: [PATCH] Check the call that leaves an argument to its NULL default on the typed surface GeneratedSqlSurfaceTest.anArgumentLeftToItsNullDefaultIsWhatTheWrapperPasses checks that tintSeqSetGaps over three instants with a gap of three days answers 2 sequences with a one-day maxt and no maxdist, the wrapper passing -1.0, and 1 with neither, the wrapper passing a NULL maxt; and that tfloatSeq of an instant without an interpolation answers a sequence, the wrapper passing INTERP_NONE. Witness: with the generator of JMEOS main the surface registers no call of tintSeqSetGaps without its NULL-default arguments, as MobilitySpark measures on the twin test, which fails there on "function tintSeqSetGaps(array, interval day) does not exist". Measured over MobilityDB 647acbe4ed, the catalog of MEOS-API catalog/null-default-binds and the generator of JMEOS codegen/null-default-arities: the binding module passes its 23 tests and the benchmark module its 12, and the build prints no warning. Why: a call leaving an argument to its default answers on Flink as it does in PostgreSQL. --- .../flink/sql/GeneratedSqlSurfaceTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/binding/src/test/java/org/mobilitydb/flink/sql/GeneratedSqlSurfaceTest.java b/binding/src/test/java/org/mobilitydb/flink/sql/GeneratedSqlSurfaceTest.java index 9dfe546..2ba45f9 100644 --- a/binding/src/test/java/org/mobilitydb/flink/sql/GeneratedSqlSurfaceTest.java +++ b/binding/src/test/java/org/mobilitydb/flink/sql/GeneratedSqlSurfaceTest.java @@ -136,6 +136,21 @@ private static String tgeompoint(String text) { + TGeomPoint.encode(GeneratedFunctions.tgeompoint_in(text)).toString() + "')"; } + @Test + void anArgumentLeftToItsNullDefaultIsWhatTheWrapperPasses() throws Exception { + // tintSeqSetGaps without maxdist splits on time alone (the wrapper's -1.0), and + // without maxt either it splits on nothing (the wrapper's NULL) + String instants = "ARRAY[tintFromText('1@2020-01-01'), tintFromText('2@2020-01-02'), " + + "tintFromText('3@2020-01-05')]"; + assertEquals(2, scalar("SELECT numSequences(tintSeqSetGaps(" + instants + + ", INTERVAL '1' DAY))")); + assertEquals(1, scalar("SELECT numSequences(tintSeqSetGaps(" + instants + "))")); + // tfloatSeq without an interpolation keeps the value's own (the wrapper's + // INTERP_NONE) and makes an instant a sequence + assertEquals("Sequence", scalar("SELECT tempSubtype(tfloatSeq(" + + "tfloatFromText('1@2020-01-01')))")); + } + @Test void anOmittedInterpolationIsTheOneOfTheType() throws Exception { // appendInstant and the sequence set constructors without an interpolation take the