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