From 8d578dba05842a19cb1c4346609830a023b45172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Zim=C3=A1nyi?= Date: Fri, 9 Oct 2026 19:35:56 +0200 Subject: [PATCH] Check the constructors from an array of fixed-size values on the typed surface GeneratedSqlSurfaceTest.arraysCrossAsFlinkArrays checks that spanset over an array of two int spans answers {[1, 3), [5, 7)}, and that set over three network points, one repeated, and over two circular buffers answers 2 values each: the elements reach MEOS as the contiguous C array spanset_make, npointset_make and cbufferset_make read. Witness: with the generator of JMEOS main the surface registers no spanset over an array of spans, and the test fails on "SQL validation failed. Invalid function call" at the call of spanset. Measured over MobilityDB 2a1d52a7ee, the catalog of MEOS-API catalog/struct-value-input-arrays and the generator of JMEOS codegen/struct-value-arrays: the binding module passes its 21 tests and the benchmark module its 12, and the build prints no warning. Why: a constructor from an array of values answers on Flink as it does in PostgreSQL. --- .../org/mobilitydb/flink/sql/GeneratedSqlSurfaceTest.java | 7 +++++++ 1 file changed, 7 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 996170e..b4eb401 100644 --- a/binding/src/test/java/org/mobilitydb/flink/sql/GeneratedSqlSurfaceTest.java +++ b/binding/src/test/java/org/mobilitydb/flink/sql/GeneratedSqlSurfaceTest.java @@ -149,6 +149,13 @@ void arraysCrossAsFlinkArrays() throws Exception { + near + "])")); assertThrows(Exception.class, () -> scalar("SELECT intset_out(`set`(ARRAY[1, CAST(NULL AS INT)]))")); + // An array of fixed-size values reaches MEOS as the contiguous C array it reads + assertEquals("{[1, 3), [5, 7)}", scalar("SELECT intspanset_out(spanset(ARRAY[" + + "intspan_in('[5, 7)'), intspan_in('[1, 3)')]))")); + assertEquals(2, scalar("SELECT numValues(`set`(ARRAY[npoint_in('NPoint(1, 0.5)'), " + + "npoint_in('NPoint(2, 0.3)'), npoint_in('NPoint(1, 0.5)')]))")); + assertEquals(2, scalar("SELECT numValues(`set`(ARRAY[cbuffer_in('Cbuffer(Point(1 1), 0.5)'), " + + "cbuffer_in('Cbuffer(Point(2 2), 1)')]))")); } @Test