From cf51df5f6c28298e993d55811bae648cdaefb91b Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Sat, 25 Apr 2026 12:47:47 +0200 Subject: [PATCH] test(parity): add 015_span_aggfuncs.test (entire file under mode skip) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ports mobilitydb/test/temporal/queries/015_span_aggfuncs.test.sql to test/sql/parity/015_span_aggfuncs.test. Whole file is wrapped in mode skip: MobilityDuck registers no AggregateFunction calls anywhere in src/temporal/ or src/geo/, so every query in this file fails with "function not found". The file stands as a tracked manifest of the aggregate surface that needs to land — extent (over span / spanset / value / set / spanset), setUnion, spanUnion, and the temporal aggregates that follow in later regression files (tcount, tand, tor, tmin, tmax, tsum). MEOS exposes the transfn / combinefn / finalfn triples for each of these; DuckDB has its own AggregateFunction registration shape that needs the wrapper layer built. Suite gains 0 active assertions (all skipped); file gains 1 test case. --- test/sql/parity/015_span_aggfuncs.test | 138 +++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 test/sql/parity/015_span_aggfuncs.test diff --git a/test/sql/parity/015_span_aggfuncs.test b/test/sql/parity/015_span_aggfuncs.test new file mode 100644 index 00000000..1e7e4729 --- /dev/null +++ b/test/sql/parity/015_span_aggfuncs.test @@ -0,0 +1,138 @@ +# name: test/sql/parity/015_span_aggfuncs.test +# description: MobilityDB regression file 015_span_aggfuncs.test.sql adapted for MobilityDuck +# group: [sql] +# +# Queries from mobilitydb/test/temporal/queries/015_span_aggfuncs.test.sql. +# Whole file currently under `mode skip`: MobilityDuck registers no +# aggregate functions (no AggregateFunction calls in src/temporal/ or +# src/geo/), so every query in this file fails with "function not +# found". Aggregate infrastructure landing is the precondition for +# turning the assertions in this file on; until then the file is a +# tracked manifest of what `extent`, `setUnion`, `spanUnion`, +# `tcount`, `tand`, `tor`, `tmin`, `tmax`, `tsum`, `tcount_transfn`, +# `tagg_combinefn`, `tagg_finalfn` etc. need to cover. + +require mobilityduck + +mode skip + +# extent() and extent() — MEOS symbol: span_extent_transfn +# / spanset_extent_transfn / span_extent_combinefn etc. + +query I +SELECT extent(temp) FROM (VALUES +(NULL::tstzspan),(NULL::tstzspan)) t(temp); +---- +NULL + +query I +SELECT extent(temp) FROM (VALUES +(NULL::tstzspan),('[2000-01-01, 2000-01-02]'::tstzspan)) t(temp); +---- +[2000-01-01 00:00:00+00, 2000-01-02 00:00:00+00] + +query I +SELECT extent(temp) FROM (VALUES +('[2000-01-01, 2000-01-02]'::tstzspan),(NULL::tstzspan)) t(temp); +---- +[2000-01-01 00:00:00+00, 2000-01-02 00:00:00+00] + +query I +SELECT extent(temp) FROM (VALUES +(NULL::tstzspanset),(NULL::tstzspanset)) t(temp); +---- +NULL + +query I +SELECT extent(temp) FROM (VALUES +(NULL::tstzspanset),('{[2000-01-01, 2000-01-02]}'::tstzspanset)) t(temp); +---- +[2000-01-01 00:00:00+00, 2000-01-02 00:00:00+00] + +query I +SELECT extent(temp) FROM (VALUES +('{[2000-01-01, 2000-01-02]}'::tstzspanset),(NULL::tstzspanset)) t(temp); +---- +[2000-01-01 00:00:00+00, 2000-01-02 00:00:00+00] + +# extent() — value-aggregate variants + +query I +SELECT extent(NULL::int) FROM generate_series(1,10); +---- +NULL + +query I +SELECT extent(NULL::bigint) FROM generate_series(1,10); +---- +NULL + +query I +SELECT extent(NULL::float) FROM generate_series(1,10); +---- +NULL + +query I +SELECT extent(NULL::timestamptz) FROM generate_series(1,10); +---- +NULL + +# extent() + +query I +SELECT extent(NULL::intset) FROM generate_series(1,10); +---- +NULL + +query I +SELECT extent(NULL::bigintset) FROM generate_series(1,10); +---- +NULL + +query I +SELECT extent(NULL::floatset) FROM generate_series(1,10); +---- +NULL + +query I +SELECT extent(NULL::tstzset) FROM generate_series(1,10); +---- +NULL + +# extent() + +query I +SELECT extent(NULL::intspanset) FROM generate_series(1,10); +---- +NULL + +query I +SELECT extent(NULL::bigintspanset) FROM generate_series(1,10); +---- +NULL + +query I +SELECT extent(NULL::floatspanset) FROM generate_series(1,10); +---- +NULL + +query I +SELECT extent(NULL::tstzspanset) FROM generate_series(1,10); +---- +NULL + +# setUnion / spanUnion — accumulator aggregates returning set / span + +query I +SELECT setUnion(t) FROM (VALUES +('{2000-01-01}'::tstzset)) t(t); +---- +{"2000-01-01 00:00:00+00"} + +query I +SELECT spanUnion(t) FROM (VALUES +('[2000-01-01, 2000-01-02]'::tstzspan)) t(t); +---- +{[2000-01-01 00:00:00+00, 2000-01-02 00:00:00+00]} + +mode unskip