diff --git a/Makefile b/Makefile index bc17d050..a9485498 100644 --- a/Makefile +++ b/Makefile @@ -11,9 +11,39 @@ include extension-ci-tools/makefiles/duckdb_extension.Makefile # both MEOS (meos_initialize_timezone) and DuckDB (DBConfig::SetOptionByName # "TimeZone") to Europe/Brussels. Tests pass on any OS timezone — the # extension is the single source of truth, no TZ env var needed. +# +# LoadInternal also calls ExtensionHelper::AutoLoadExtension(db, "icu") so +# the timezone option is honoured. Autoload looks for the extension on disk +# at $HOME/.duckdb/extensions///icu.duckdb_extension +# and falls back to a hub download. That fails both inside the linux_amd64 +# test docker container (empty path, no network egress) and on the macOS +# osx_arm64 test runner (hub icu not reliably resolvable). We copy the +# icu.duckdb_extension that was built locally as part of this extension's +# build (declared in extension_config.cmake) into the expected path, +# matched to the DuckDB platform string, before running the unittester. +DUCKDB_VERSION_TAG := v1.4.4 + +define stage_icu + @if [ -f ./build/$(1)/extension/icu/icu.duckdb_extension ]; then \ + case "$$(uname -s)-$$(uname -m)" in \ + Linux-x86_64) platform=linux_amd64 ;; \ + Linux-aarch64) platform=linux_arm64 ;; \ + Darwin-arm64) platform=osx_arm64 ;; \ + Darwin-x86_64) platform=osx_amd64 ;; \ + *) platform=$$(uname -m) ;; \ + esac; \ + target=$$HOME/.duckdb/extensions/$(DUCKDB_VERSION_TAG)/$$platform; \ + mkdir -p "$$target" && cp -f ./build/$(1)/extension/icu/icu.duckdb_extension "$$target/" && \ + echo "Staged icu.duckdb_extension at $$target/"; \ + fi +endef + test_release_internal: + $(call stage_icu,release) ./build/release/$(TEST_PATH) "$(PROJ_DIR)test/*" test_debug_internal: + $(call stage_icu,debug) ./build/debug/$(TEST_PATH) "$(PROJ_DIR)test/*" test_reldebug_internal: - ./build/reldebug/$(TEST_PATH) "$(PROJ_DIR)test/*" \ No newline at end of file + $(call stage_icu,reldebug) + ./build/reldebug/$(TEST_PATH) "$(PROJ_DIR)test/*" diff --git a/src/geo/spatial_aggregates.cpp b/src/geo/spatial_aggregates.cpp index 27462eaf..1633e446 100644 --- a/src/geo/spatial_aggregates.cpp +++ b/src/geo/spatial_aggregates.cpp @@ -281,7 +281,7 @@ void SpatialAggregates::AddExtentOverloads(AggregateFunctionSet &extent_set) { } void SpatialAggregates::RegisterTcentroid(ExtensionLoader &loader) { - AggregateFunctionSet tcentroid_set("TcentroidAgg"); + AggregateFunctionSet tcentroid_set("Tcentroid"); tcentroid_set.AddFunction(MakeTcentroidAggregate(TgeompointType::TGEOMPOINT())); loader.RegisterFunction(std::move(tcentroid_set)); } diff --git a/src/include/temporal/set.hpp b/src/include/temporal/set.hpp index ed4b21d0..5ac234f6 100644 --- a/src/include/temporal/set.hpp +++ b/src/include/temporal/set.hpp @@ -30,7 +30,7 @@ struct SetTypes { static void RegisterCastFunctions(ExtensionLoader &loader); static void RegisterScalarFunctions(ExtensionLoader &loader); static void RegisterSetUnnest(ExtensionLoader &loader); - static void RegisterSetUnionAgg(ExtensionLoader &loader); + static void RegisterSetUnion(ExtensionLoader &loader); }; struct SetTypeMapping { diff --git a/src/include/temporal/span_aggregates.hpp b/src/include/temporal/span_aggregates.hpp index 76cbafb5..1e7f88e9 100644 --- a/src/include/temporal/span_aggregates.hpp +++ b/src/include/temporal/span_aggregates.hpp @@ -6,7 +6,7 @@ namespace duckdb { struct SpanAggregates { - // Register all span-typed extent() overloads and SpanUnionAgg. + // Register all span-typed extent() overloads and SpanUnion. static void RegisterAggregateFunctions(ExtensionLoader &loader); }; diff --git a/src/include/tydef.hpp b/src/include/tydef.hpp index b7b28109..b9860ca0 100644 --- a/src/include/tydef.hpp +++ b/src/include/tydef.hpp @@ -11,11 +11,27 @@ extern "C" { #include } -// Forward-compat alias for the meosType → MeosType rename (MobilityDB -// pr785-sync-script). Vcpkg's MEOS exposes `MeosType`; existing -// MobilityDuck code still uses `meosType`. This alias bridges the two -// without touching every reference site. -using meosType = MeosType; +// MEOS naming history: `meosType` is the **pre-consolidation** spelling +// and `MeosType` is the **post-consolidation** target (the rename is +// part of the upstream consolidation sweep, not yet reached by the +// vcpkg pin). The current pin +// (`vcpkg_ports/meos/portfile.cmake` REF f11b7443ee98…) is still +// pre-consolidation and exposes `meosType` — see +// meos/include/temporal/meos_catalog.h, where line 121 declares +// `} meosType;`. MobilityDuck's source consistently uses +// `meosType` (verified via `grep -rn '\bmeosType\b' src/`), which +// matches the pin, so no alias is needed today. +// +// An earlier version of this file added `using meosType = MeosType;` +// as a forward-looking bridge for the eventual consolidation bump. +// That alias references `MeosType`, which the current pin does NOT +// yet expose, so it broke the build: +// "'MeosType' does not name a type; did you mean 'meosType'?". +// +// When the MEOS pin is bumped past the consolidation point, restore +// a bridge here (`using meosType = MeosType;` becomes valid then) or +// sweep the source `meosType → MeosType` in one PR — whichever the +// project prefers at that time. namespace duckdb { diff --git a/src/temporal/set.cpp b/src/temporal/set.cpp index b803498a..64f9e3ea 100644 --- a/src/temporal/set.cpp +++ b/src/temporal/set.cpp @@ -927,15 +927,15 @@ void SetTypes::RegisterSetUnnest(ExtensionLoader &loader) { } // ============================================================================ -// SetUnionAgg — aggregate that unions sets or scalar values into a Set. +// SetUnion — aggregate that unions sets or scalar values into a Set. // // Overloads: -// SetUnionAgg(int) → intset (via int_to_set + set_union_transfn) -// SetUnionAgg(bigint) → bigintset (via bigint_to_set) -// SetUnionAgg(float) → floatset (via float_to_set) -// SetUnionAgg(date) → dateset (via date_to_set) -// SetUnionAgg(intset) → intset (direct set_union_transfn) -// SetUnionAgg(dateset) → dateset +// SetUnion(int) → intset (via int_to_set + set_union_transfn) +// SetUnion(bigint) → bigintset (via bigint_to_set) +// SetUnion(float) → floatset (via float_to_set) +// SetUnion(date) → dateset (via date_to_set) +// SetUnion(intset) → intset (direct set_union_transfn) +// SetUnion(dateset) → dateset // ... etc. for all Set types // ============================================================================ @@ -981,7 +981,7 @@ static inline void SetUnionFinalize(SetPtrState &state, string_t &target, free(result); } -// SetUnionAgg(scalar) — Operation converts scalar to a single-element Set +// SetUnion(scalar) — Operation converts scalar to a single-element Set // then calls set_union_transfn. template struct SetUnionScalarFunction { @@ -1019,7 +1019,7 @@ struct SetUnionScalarFunction { } }; -// SetUnionAgg(Set) — Operation copies the blob and calls set_union_transfn. +// SetUnion(Set) — Operation copies the blob and calls set_union_transfn. struct SetUnionSetFunction { template static void Initialize(STATE &state) { state.accumulated = nullptr; } @@ -1059,8 +1059,8 @@ struct SetUnionSetFunction { } // anonymous namespace -void SetTypes::RegisterSetUnionAgg(ExtensionLoader &loader) { - AggregateFunctionSet set_union_set("SetUnionAgg"); +void SetTypes::RegisterSetUnion(ExtensionLoader &loader) { + AggregateFunctionSet set_union_set("SetUnion"); // Scalar overloads: convert each value to a single-element Set. set_union_set.AddFunction( diff --git a/src/temporal/temporal_aggregates.cpp b/src/temporal/temporal_aggregates.cpp index aa933666..6f8b2033 100644 --- a/src/temporal/temporal_aggregates.cpp +++ b/src/temporal/temporal_aggregates.cpp @@ -1,9 +1,9 @@ -// SkipList-state temporal aggregates: TcountAgg, TandAgg, TorAgg, TminAgg, -// TmaxAgg, TsumAgg, TavgAgg, TcentroidAgg. Names follow MobilityDB RFC #827: -// every SkipList aggregate is exposed under a Pascal-cased *Agg identifier, -// disambiguating it from the same-stem scalar accessors (Tmin(tbox), etc.) -// in case-folding catalogs like DuckDB. These differ from the fixed-state -// `extent()` aggregates in two ways: +// SkipList-state temporal aggregates: Tcount, Tand, Tor, Tmin, Tmax, Tsum, +// Tavg, Tcentroid. The aggregate names match their MobilityDB SQL form. +// Collisions with same-stem scalar accessors (e.g. Tmin(tbox), Tmax(stbox)) +// are resolved by DuckDB's argument-type dispatch: the aggregate takes a +// temporal value, the scalar takes a box, so they coexist without suffix. +// These differ from the fixed-state `extent()` aggregates in two ways: // // 1. State holds a `SkipList *` pointer; the skiplist owns variable-size // heap-allocated Temporal* values, so the aggregate needs a destructor. @@ -193,7 +193,7 @@ struct TemporalSkipListAggFn { #define DECLARE_TAGG(NAME, TRANSFN, FINALFN, MERGE_FN, CROSSINGS) \ using NAME = TemporalSkipListAggFn; -// TcountAgg variants over time-only inputs use distinct transfn signatures. +// Tcount variants over time-only inputs use distinct transfn signatures. // The blob-shaped ones (set / span / spanset) all funnel through a common // blob-casting wrapper; the scalar timestamptz one needs its own functor // since the input isn't a string_t blob. @@ -215,7 +215,7 @@ DECLARE_TAGG(TcountTstzsetFn, TcountTstzsetTransfn, temporal_tagg_final DECLARE_TAGG(TcountTstzspanFn, TcountTstzspanTransfn, temporal_tagg_finalfn, datum_sum_int32, false) DECLARE_TAGG(TcountTstzspansetFn, TcountTstzspansetTransfn, temporal_tagg_finalfn, datum_sum_int32, false) -// TcountAgg(timestamptz) — input is a scalar TimestampTz, not a blob. +// Tcount(timestamptz) — input is a scalar TimestampTz, not a blob. struct TcountTstzFn { template static void Initialize(STATE &state) { state.skiplist = nullptr; } @@ -420,7 +420,7 @@ struct WindowAggFn { } }; -// WcountAgg: input is transformed through `temporal_transform_wcount` +// Wcount: input is transformed through `temporal_transform_wcount` // before being aggregated with `datum_sum_int32`. The result is always // a tint regardless of input subtype. struct WcountAggFn { @@ -494,7 +494,7 @@ static AggregateFunction MakeWindowAggregate(const LogicalType &input_type, cons } // ===================================================================== -// MergeAgg: same SkipList state, but with no per-instant merge functor. +// Merge: same SkipList state, but with no per-instant merge functor. // MEOS treats `func == NULL` as "concatenate values without conflict // resolution"; the resulting Temporal is the merged sequence/sequenceset. // ===================================================================== @@ -557,7 +557,7 @@ struct MergeAggFn { }; // ===================================================================== -// AppendInstantAgg / AppendSequenceAgg: state shape is `Temporal *` +// AppendInstant / AppendSequence: state shape is `Temporal *` // (not a SkipList). The MEOS transfn mutates the state Temporal in // place and returns either the same pointer or a freshly-allocated // successor. Combine merges two states via the public `temporal_merge`. @@ -604,7 +604,7 @@ struct TemporalStateCombineBase { } }; -// AppendInstantAgg(temporal) — uses default LINEAR-or-discrete interpretation +// AppendInstant(temporal) — uses default LINEAR-or-discrete interpretation // inferred from the temporal subtype, no maxdist / maxt thresholds. struct AppendInstantAggFn : TemporalStateCombineBase<> { template @@ -615,7 +615,7 @@ struct AppendInstantAggFn : TemporalStateCombineBase<> { static void Operation(STATE &state, const INPUT_TYPE &input, AggregateUnaryInput &) { const Temporal *t = reinterpret_cast(input.GetData()); // The MEOS transfn expects a TInstant *; an aggregate input that - // is already a sequence falls through to AppendSequenceAgg. + // is already a sequence falls through to AppendSequence. const TInstant *inst = reinterpret_cast(t); // INTERP_NONE lets MEOS pick the natural interpretation for the // base type (DISCRETE for tbool/ttext, LINEAR for tnumber/tgeo). @@ -628,7 +628,7 @@ struct AppendInstantAggFn : TemporalStateCombineBase<> { } }; -// AppendSequenceAgg(temporal) — input is already a TSequence. +// AppendSequence(temporal) — input is already a TSequence. struct AppendSequenceAggFn : TemporalStateCombineBase<> { template static void Initialize(STATE &state) { state.value = nullptr; } @@ -653,7 +653,7 @@ static AggregateFunction MakeTemporalStateAggregate(const LogicalType &type) { } // ===================================================================== -// SpanUnionAgg: state shape is `SpanSet *`. Each input span/spanset is +// SpanUnion: state shape is `SpanSet *`. Each input span/spanset is // folded into the state via MEOS's union transfns. Final state is the // state itself (no separate finalfn — `spanset_union_finalfn` is a // passthrough at this point). @@ -702,7 +702,7 @@ inline void SpanSetDestroy(STATE &state) { } } -// SpanUnionAgg() — input is a Span blob. +// SpanUnion() — input is a Span blob. struct SpanUnionFromSpanFn { template static void Initialize(STATE &state) { state.value = nullptr; } @@ -729,7 +729,7 @@ struct SpanUnionFromSpanFn { static void Destroy(STATE &state, AggregateInputData &) { SpanSetDestroy(state); } }; -// SpanUnionAgg() — input is a SpanSet blob. +// SpanUnion() — input is a SpanSet blob. struct SpanUnionFromSpanSetFn { template static void Initialize(STATE &state) { state.value = nullptr; } @@ -763,7 +763,7 @@ static AggregateFunction MakeSpanSetAggregate(const LogicalType &input_type, con } // ===================================================================== -// SetUnionAgg: state shape is `Set *`. Inputs come in two flavours — +// SetUnion: state shape is `Set *`. Inputs come in two flavours — // scalars (folded via `value_union_transfn`) and sets (folded via // `set_union_transfn`). // ===================================================================== @@ -807,7 +807,7 @@ inline void SetDestroy(STATE &state) { } } -// SetUnionAgg() — input is a Set blob. +// SetUnion() — input is a Set blob. struct SetUnionFromSetFn { template static void Initialize(STATE &state) { state.value = nullptr; } @@ -834,7 +834,7 @@ struct SetUnionFromSetFn { static void Destroy(STATE &state, AggregateInputData &) { SetDestroy(state); } }; -// SetUnionAgg() — input is a primitive value lifted to a Datum. +// SetUnion() — input is a primitive value lifted to a Datum. template struct SetUnionFromScalarFn { template @@ -905,30 +905,27 @@ static AggregateFunction MakeSetUnionScalarAggregate(const LogicalType &input_ty } // namespace void TemporalAggregates::RegisterAggregateFunctions(ExtensionLoader &loader) { - // SkipList aggregates are registered under the Pascal-cased *Agg names - // proposed in MobilityDB RFC #827. These avoid the case-folding - // collision DuckDB's catalog hits when an aggregate and a scalar share - // a canonical lowercase name (e.g. previously `tmin` aggregate vs the - // existing `Tmin(tbox)` scalar). The MobilityDB upstream PR #828 adds - // the matching aliases on the PG side; the original aggregate names - // (`tand`, `tcount`, etc.) remain valid in PG for backward compat but - // collide in DuckDB and are intentionally not registered here. - - // ---- TandAgg / TorAgg on tbool ---- + // Aggregates are registered under their MobilityDB SQL names. Same-stem + // collisions with scalar accessors (e.g. `Tmin(tbox)` scalar vs `Tmin` + // aggregate over a temporal value) are resolved by DuckDB's argument-type + // dispatch: the aggregate takes a temporal value, the scalar takes a box, + // so they coexist without a name suffix. + + // ---- Tand / Tor on tbool ---- { - AggregateFunctionSet set("TandAgg"); + AggregateFunctionSet set("Tand"); set.AddFunction(MakeTaggAggregate(TemporalTypes::TBOOL(), TemporalTypes::TBOOL())); loader.RegisterFunction(std::move(set)); } { - AggregateFunctionSet set("TorAgg"); + AggregateFunctionSet set("Tor"); set.AddFunction(MakeTaggAggregate(TemporalTypes::TBOOL(), TemporalTypes::TBOOL())); loader.RegisterFunction(std::move(set)); } - // ---- TcountAgg over each temporal type and over time-only inputs → tint ---- + // ---- Tcount over each temporal type and over time-only inputs → tint ---- { - AggregateFunctionSet set("TcountAgg"); + AggregateFunctionSet set("Tcount"); for (const auto &t : {TemporalTypes::TBOOL(), TemporalTypes::TINT(), TemporalTypes::TFLOAT(), TemporalTypes::TTEXT()}) { set.AddFunction(MakeTaggAggregate(t, TemporalTypes::TINT())); @@ -950,41 +947,41 @@ void TemporalAggregates::RegisterAggregateFunctions(ExtensionLoader &loader) { loader.RegisterFunction(std::move(set)); } - // ---- TminAgg / TmaxAgg on tint, tfloat, ttext ---- + // ---- Tmin / Tmax on tint, tfloat, ttext ---- { - AggregateFunctionSet set("TminAgg"); + AggregateFunctionSet set("Tmin"); set.AddFunction(MakeTaggAggregate(TemporalTypes::TINT(), TemporalTypes::TINT())); set.AddFunction(MakeTaggAggregate(TemporalTypes::TFLOAT(), TemporalTypes::TFLOAT())); set.AddFunction(MakeTaggAggregate(TemporalTypes::TTEXT(), TemporalTypes::TTEXT())); loader.RegisterFunction(std::move(set)); } { - AggregateFunctionSet set("TmaxAgg"); + AggregateFunctionSet set("Tmax"); set.AddFunction(MakeTaggAggregate(TemporalTypes::TINT(), TemporalTypes::TINT())); set.AddFunction(MakeTaggAggregate(TemporalTypes::TFLOAT(), TemporalTypes::TFLOAT())); set.AddFunction(MakeTaggAggregate(TemporalTypes::TTEXT(), TemporalTypes::TTEXT())); loader.RegisterFunction(std::move(set)); } - // ---- TsumAgg on tint, tfloat ---- + // ---- Tsum on tint, tfloat ---- { - AggregateFunctionSet set("TsumAgg"); + AggregateFunctionSet set("Tsum"); set.AddFunction(MakeTaggAggregate(TemporalTypes::TINT(), TemporalTypes::TINT())); set.AddFunction(MakeTaggAggregate(TemporalTypes::TFLOAT(), TemporalTypes::TFLOAT())); loader.RegisterFunction(std::move(set)); } - // ---- TavgAgg on tint, tfloat → tfloat ---- + // ---- Tavg on tint, tfloat → tfloat ---- { - AggregateFunctionSet set("TavgAgg"); + AggregateFunctionSet set("Tavg"); set.AddFunction(MakeTaggAggregate(TemporalTypes::TINT(), TemporalTypes::TFLOAT())); set.AddFunction(MakeTaggAggregate(TemporalTypes::TFLOAT(), TemporalTypes::TFLOAT())); loader.RegisterFunction(std::move(set)); } - // ---- TcentroidAgg on tgeompoint / tgeogpoint → same type ---- + // ---- Tcentroid on tgeompoint / tgeogpoint → same type ---- { - AggregateFunctionSet set("TcentroidAgg"); + AggregateFunctionSet set("Tcentroid"); set.AddFunction(MakeTaggAggregate( TgeompointType::TGEOMPOINT(), TgeompointType::TGEOMPOINT())); set.AddFunction(MakeTaggAggregate( @@ -992,9 +989,9 @@ void TemporalAggregates::RegisterAggregateFunctions(ExtensionLoader &loader) { loader.RegisterFunction(std::move(set)); } - // ---- MergeAgg over each temporal type → same type ---- + // ---- Merge over each temporal type → same type ---- { - AggregateFunctionSet set("MergeAgg"); + AggregateFunctionSet set("Merge"); for (const auto &t : {TemporalTypes::TBOOL(), TemporalTypes::TINT(), TemporalTypes::TFLOAT(), TemporalTypes::TTEXT()}) { set.AddFunction(MakeTaggAggregate(t, t)); @@ -1010,9 +1007,9 @@ void TemporalAggregates::RegisterAggregateFunctions(ExtensionLoader &loader) { loader.RegisterFunction(std::move(set)); } - // ---- AppendInstantAgg over each temporal type → same type ---- + // ---- AppendInstant over each temporal type → same type ---- { - AggregateFunctionSet set("AppendInstantAgg"); + AggregateFunctionSet set("AppendInstant"); for (const auto &t : {TemporalTypes::TBOOL(), TemporalTypes::TINT(), TemporalTypes::TFLOAT(), TemporalTypes::TTEXT()}) { set.AddFunction(MakeTemporalStateAggregate(t)); @@ -1024,9 +1021,9 @@ void TemporalAggregates::RegisterAggregateFunctions(ExtensionLoader &loader) { loader.RegisterFunction(std::move(set)); } - // ---- AppendSequenceAgg over each temporal type → same type ---- + // ---- AppendSequence over each temporal type → same type ---- { - AggregateFunctionSet set("AppendSequenceAgg"); + AggregateFunctionSet set("AppendSequence"); for (const auto &t : {TemporalTypes::TBOOL(), TemporalTypes::TINT(), TemporalTypes::TFLOAT(), TemporalTypes::TTEXT()}) { set.AddFunction(MakeTemporalStateAggregate(t)); @@ -1038,13 +1035,13 @@ void TemporalAggregates::RegisterAggregateFunctions(ExtensionLoader &loader) { loader.RegisterFunction(std::move(set)); } - // ---- SpanUnionAgg(span | spanset) -> typed spanset ---- + // ---- SpanUnion(span | spanset) -> typed spanset ---- struct SpanInputPair { LogicalType in; LogicalType out; }; { - AggregateFunctionSet set("SpanUnionAgg"); + AggregateFunctionSet set("SpanUnion"); const std::vector span_pairs = { {SpanTypes::INTSPAN(), SpansetTypes::intspanset()}, {SpanTypes::BIGINTSPAN(), SpansetTypes::bigintspanset()}, @@ -1068,41 +1065,41 @@ void TemporalAggregates::RegisterAggregateFunctions(ExtensionLoader &loader) { loader.RegisterFunction(std::move(set)); } - // ---- Window aggregates: WminAgg / WmaxAgg / WsumAgg / WcountAgg / WavgAgg ---- + // ---- Window aggregates: Wmin / Wmax / Wsum / Wcount / Wavg ---- { - AggregateFunctionSet set("WminAgg"); + AggregateFunctionSet set("Wmin"); set.AddFunction(MakeWindowAggregate(TemporalTypes::TINT(), TemporalTypes::TINT())); set.AddFunction(MakeWindowAggregate(TemporalTypes::TFLOAT(), TemporalTypes::TFLOAT())); loader.RegisterFunction(std::move(set)); } { - AggregateFunctionSet set("WmaxAgg"); + AggregateFunctionSet set("Wmax"); set.AddFunction(MakeWindowAggregate(TemporalTypes::TINT(), TemporalTypes::TINT())); set.AddFunction(MakeWindowAggregate(TemporalTypes::TFLOAT(), TemporalTypes::TFLOAT())); loader.RegisterFunction(std::move(set)); } { - AggregateFunctionSet set("WsumAgg"); + AggregateFunctionSet set("Wsum"); set.AddFunction(MakeWindowAggregate(TemporalTypes::TINT(), TemporalTypes::TINT())); set.AddFunction(MakeWindowAggregate(TemporalTypes::TFLOAT(), TemporalTypes::TFLOAT())); loader.RegisterFunction(std::move(set)); } { - AggregateFunctionSet set("WcountAgg"); + AggregateFunctionSet set("Wcount"); set.AddFunction(MakeWindowAggregate(TemporalTypes::TINT(), TemporalTypes::TINT())); set.AddFunction(MakeWindowAggregate(TemporalTypes::TFLOAT(), TemporalTypes::TINT())); loader.RegisterFunction(std::move(set)); } { - AggregateFunctionSet set("WavgAgg"); + AggregateFunctionSet set("Wavg"); set.AddFunction(MakeWindowAggregate(TemporalTypes::TINT(), TemporalTypes::TFLOAT())); set.AddFunction(MakeWindowAggregate(TemporalTypes::TFLOAT(), TemporalTypes::TFLOAT())); loader.RegisterFunction(std::move(set)); } - // ---- SetUnionAgg() -> typed set ---- + // ---- SetUnion() -> typed set ---- { - AggregateFunctionSet set("SetUnionAgg"); + AggregateFunctionSet set("SetUnion"); // Scalar inputs. set.AddFunction(MakeSetUnionScalarAggregate( LogicalType::INTEGER, SetTypes::intset())); diff --git a/test/sql/parity/015_span_aggfuncs.test b/test/sql/parity/015_span_aggfuncs.test index dc410e3b..2b13a68c 100644 --- a/test/sql/parity/015_span_aggfuncs.test +++ b/test/sql/parity/015_span_aggfuncs.test @@ -3,9 +3,8 @@ # group: [sql] # # Queries from mobilitydb/test/temporal/queries/015_span_aggfuncs.test.sql. -# Aggregate infrastructure (extent, SpanUnionAgg, SetUnionAgg) is now -# registered; this file is fully active. Function names follow RFC #827: -# setUnion → SetUnionAgg, spanUnion → SpanUnionAgg. +# Aggregate infrastructure (extent, SpanUnion, SetUnion) is registered; +# this file is fully active. Names match MobilityDB SQL. require mobilityduck @@ -114,16 +113,16 @@ SELECT extent(NULL::tstzspanset) FROM generate_series(1,10); ---- NULL -# SetUnionAgg / SpanUnionAgg — accumulator aggregates returning set / span +# SetUnion / SpanUnion — accumulator aggregates returning set / span query I -SELECT SetUnionAgg(t::tstzset)::VARCHAR FROM (VALUES +SELECT SetUnion(t::tstzset)::VARCHAR FROM (VALUES ('{2000-01-01}'::tstzset)) t(t); ---- {"2000-01-01 00:00:00+01"} query I -SELECT SpanUnionAgg(t::tstzspan)::VARCHAR FROM (VALUES +SELECT SpanUnion(t::tstzspan)::VARCHAR FROM (VALUES ('[2000-01-01, 2000-01-02]'::tstzspan)) t(t); ---- {[2000-01-01 00:00:00+01, 2000-01-02 00:00:00+01]} diff --git a/test/sql/parity/031_aggregates_skiplist.test b/test/sql/parity/031_aggregates_skiplist.test index 1f42b612..1f7bd2bc 100644 --- a/test/sql/parity/031_aggregates_skiplist.test +++ b/test/sql/parity/031_aggregates_skiplist.test @@ -1,11 +1,11 @@ # name: test/sql/parity/031_aggregates_skiplist.test -# description: SkipList-state aggregates — TandAgg, TorAgg, TcountAgg, TminAgg, -# TmaxAgg, TsumAgg, TavgAgg, TcentroidAgg, MergeAgg, -# AppendInstantAgg, AppendSequenceAgg, SpanUnionAgg, SetUnionAgg, -# and the window aggregates W{min,max,sum,count,avg}Agg. Names -# follow MobilityDB RFC #827 — every SkipList aggregate is -# exposed under a Pascal-cased *Agg identifier. The MobilityDB -# upstream PR #828 adds the matching aliases on the PG side. +# description: SkipList-state aggregates — Tand, Tor, Tcount, Tmin, +# Tmax, Tsum, Tavg, Tcentroid, Merge, AppendInstant, +# AppendSequence, SpanUnion, SetUnion, and the window +# aggregates W{min,max,sum,count,avg}. Names match the +# MobilityDB SQL form; same-stem scalar collisions +# (Tmin(tbox), Tmax(stbox)) resolve via DuckDB's +# argument-type dispatch. # group: [sql] require mobilityduck @@ -16,214 +16,214 @@ statement ok SET TimeZone='UTC' # ============================================================================= -# TandAgg / TorAgg on tbool +# Tand / Tor on tbool # ============================================================================= query I -SELECT TandAgg(v::tbool)::VARCHAR FROM (VALUES ('true@2000-01-01'),('true@2000-01-02')) t(v); +SELECT Tand(v::tbool)::VARCHAR FROM (VALUES ('true@2000-01-01'),('true@2000-01-02')) t(v); ---- {t@2000-01-01 00:00:00+01, t@2000-01-02 00:00:00+01} query I -SELECT TorAgg(v::tbool)::VARCHAR FROM (VALUES ('true@2000-01-01'),('false@2000-01-02')) t(v); +SELECT Tor(v::tbool)::VARCHAR FROM (VALUES ('true@2000-01-01'),('false@2000-01-02')) t(v); ---- {t@2000-01-01 00:00:00+01, f@2000-01-02 00:00:00+01} # Single-row aggregate degenerates to identity over the input. query I -SELECT TandAgg(v::tbool)::VARCHAR FROM (VALUES ('true@2000-01-01')) t(v); +SELECT Tand(v::tbool)::VARCHAR FROM (VALUES ('true@2000-01-01')) t(v); ---- {t@2000-01-01 00:00:00+01} # ============================================================================= -# TcountAgg over each temporal type → tint +# Tcount over each temporal type → tint # ============================================================================= query I -SELECT TcountAgg(v::tint)::VARCHAR FROM (VALUES ('1@2000-01-01'),('5@2000-01-02')) t(v); +SELECT Tcount(v::tint)::VARCHAR FROM (VALUES ('1@2000-01-01'),('5@2000-01-02')) t(v); ---- {1@2000-01-01 00:00:00+01, 1@2000-01-02 00:00:00+01} query I -SELECT TcountAgg(v::tfloat)::VARCHAR FROM (VALUES ('1.5@2000-01-01'),('5.5@2000-01-02')) t(v); +SELECT Tcount(v::tfloat)::VARCHAR FROM (VALUES ('1.5@2000-01-01'),('5.5@2000-01-02')) t(v); ---- {1@2000-01-01 00:00:00+01, 1@2000-01-02 00:00:00+01} query I -SELECT TcountAgg(v::tbool)::VARCHAR FROM (VALUES ('true@2000-01-01'),('false@2000-01-02')) t(v); +SELECT Tcount(v::tbool)::VARCHAR FROM (VALUES ('true@2000-01-01'),('false@2000-01-02')) t(v); ---- {1@2000-01-01 00:00:00+01, 1@2000-01-02 00:00:00+01} query I -SELECT TcountAgg(v::ttext)::VARCHAR FROM (VALUES ('"hi"@2000-01-01'),('"bye"@2000-01-02')) t(v); +SELECT Tcount(v::ttext)::VARCHAR FROM (VALUES ('"hi"@2000-01-01'),('"bye"@2000-01-02')) t(v); ---- {1@2000-01-01 00:00:00+01, 1@2000-01-02 00:00:00+01} # ============================================================================= -# TminAgg / TmaxAgg on tint, tfloat, ttext +# Tmin / Tmax on tint, tfloat, ttext # ============================================================================= query I -SELECT TminAgg(v::tint)::VARCHAR FROM (VALUES ('1@2000-01-01'),('5@2000-01-02'),('3@2000-01-03')) t(v); +SELECT Tmin(v::tint)::VARCHAR FROM (VALUES ('1@2000-01-01'),('5@2000-01-02'),('3@2000-01-03')) t(v); ---- {1@2000-01-01 00:00:00+01, 5@2000-01-02 00:00:00+01, 3@2000-01-03 00:00:00+01} query I -SELECT TmaxAgg(v::tint)::VARCHAR FROM (VALUES ('1@2000-01-01'),('5@2000-01-02'),('3@2000-01-03')) t(v); +SELECT Tmax(v::tint)::VARCHAR FROM (VALUES ('1@2000-01-01'),('5@2000-01-02'),('3@2000-01-03')) t(v); ---- {1@2000-01-01 00:00:00+01, 5@2000-01-02 00:00:00+01, 3@2000-01-03 00:00:00+01} query I -SELECT TminAgg(v::tfloat)::VARCHAR FROM (VALUES ('1.5@2000-01-01'),('5.5@2000-01-02')) t(v); +SELECT Tmin(v::tfloat)::VARCHAR FROM (VALUES ('1.5@2000-01-01'),('5.5@2000-01-02')) t(v); ---- {1.5@2000-01-01 00:00:00+01, 5.5@2000-01-02 00:00:00+01} query I -SELECT TmaxAgg(v::ttext)::VARCHAR FROM (VALUES ('"a"@2000-01-01'),('"z"@2000-01-02')) t(v); +SELECT Tmax(v::ttext)::VARCHAR FROM (VALUES ('"a"@2000-01-01'),('"z"@2000-01-02')) t(v); ---- {"a"@2000-01-01 00:00:00+01, "z"@2000-01-02 00:00:00+01} # ============================================================================= -# TsumAgg on tint, tfloat +# Tsum on tint, tfloat # ============================================================================= query I -SELECT TsumAgg(v::tint)::VARCHAR FROM (VALUES ('1@2000-01-01'),('5@2000-01-02')) t(v); +SELECT Tsum(v::tint)::VARCHAR FROM (VALUES ('1@2000-01-01'),('5@2000-01-02')) t(v); ---- {1@2000-01-01 00:00:00+01, 5@2000-01-02 00:00:00+01} query I -SELECT TsumAgg(v::tfloat)::VARCHAR FROM (VALUES ('1.5@2000-01-01'),('2.5@2000-01-02')) t(v); +SELECT Tsum(v::tfloat)::VARCHAR FROM (VALUES ('1.5@2000-01-01'),('2.5@2000-01-02')) t(v); ---- {1.5@2000-01-01 00:00:00+01, 2.5@2000-01-02 00:00:00+01} # ============================================================================= -# TavgAgg on tint, tfloat → tfloat +# Tavg on tint, tfloat → tfloat # ============================================================================= query I -SELECT TavgAgg(v::tint)::VARCHAR FROM (VALUES ('2@2000-01-01'),('4@2000-01-02')) t(v); +SELECT Tavg(v::tint)::VARCHAR FROM (VALUES ('2@2000-01-01'),('4@2000-01-02')) t(v); ---- {2@2000-01-01 00:00:00+01, 4@2000-01-02 00:00:00+01} query I -SELECT TavgAgg(v::tfloat)::VARCHAR FROM (VALUES ('2.0@2000-01-01'),('4.0@2000-01-02')) t(v); +SELECT Tavg(v::tfloat)::VARCHAR FROM (VALUES ('2.0@2000-01-01'),('4.0@2000-01-02')) t(v); ---- {2@2000-01-01 00:00:00+01, 4@2000-01-02 00:00:00+01} # ============================================================================= -# TcentroidAgg on tgeompoint +# Tcentroid on tgeompoint # # Output is the EWKB-hex display format MobilityDuck uses for geometry, not # WKT — both points encode the input coordinates verbatim. # ============================================================================= query I -SELECT TcentroidAgg(v::tgeompoint)::VARCHAR FROM (VALUES +SELECT Tcentroid(v::tgeompoint)::VARCHAR FROM (VALUES ('Point(0 0)@2000-01-01'),('Point(2 4)@2000-01-02')) t(v); ---- {010100000000000000000000000000000000000000@2000-01-01 00:00:00+01, 010100000000000000000000400000000000001040@2000-01-02 00:00:00+01} # ============================================================================= -# TcountAgg over time-only inputs (timestamptz / tstzset / tstzspan / tstzspanset) +# Tcount over time-only inputs (timestamptz / tstzset / tstzspan / tstzspanset) # ============================================================================= query I -SELECT TcountAgg(t::timestamptz)::VARCHAR FROM (VALUES +SELECT Tcount(t::timestamptz)::VARCHAR FROM (VALUES ('2000-01-01 00:00:00+00'::timestamptz), ('2000-01-02 00:00:00+00')) t(t); ---- {1@2000-01-01 01:00:00+01, 1@2000-01-02 01:00:00+01} query I -SELECT TcountAgg(s::tstzset)::VARCHAR FROM (VALUES +SELECT Tcount(s::tstzset)::VARCHAR FROM (VALUES ('{2000-01-01, 2000-01-02}'::tstzset), ('{2000-01-02, 2000-01-03}')) t(s); ---- {1@2000-01-01 00:00:00+01, 2@2000-01-02 00:00:00+01, 1@2000-01-03 00:00:00+01} query I -SELECT TcountAgg(s::tstzspan)::VARCHAR FROM (VALUES +SELECT Tcount(s::tstzspan)::VARCHAR FROM (VALUES ('[2000-01-01, 2000-01-03)'::tstzspan), ('[2000-01-02, 2000-01-04)')) t(s); ---- {[1@2000-01-01 00:00:00+01, 2@2000-01-02 00:00:00+01, 1@2000-01-03 00:00:00+01, 1@2000-01-04 00:00:00+01)} query I -SELECT TcountAgg(s::tstzspanset)::VARCHAR FROM (VALUES +SELECT Tcount(s::tstzspanset)::VARCHAR FROM (VALUES ('{[2000-01-01, 2000-01-03)}'::tstzspanset), ('{[2000-01-02, 2000-01-04)}')) t(s); ---- {[1@2000-01-01 00:00:00+01, 2@2000-01-02 00:00:00+01, 1@2000-01-03 00:00:00+01, 1@2000-01-04 00:00:00+01)} # ============================================================================= -# MergeAgg / AppendInstantAgg / AppendSequenceAgg +# Merge / AppendInstant / AppendSequence # ============================================================================= query I -SELECT MergeAgg(v::tint)::VARCHAR FROM (VALUES ('1@2000-01-01'),('5@2000-01-02')) t(v); +SELECT Merge(v::tint)::VARCHAR FROM (VALUES ('1@2000-01-01'),('5@2000-01-02')) t(v); ---- {1@2000-01-01 00:00:00+01, 5@2000-01-02 00:00:00+01} query I -SELECT AppendInstantAgg(v::tint)::VARCHAR FROM (VALUES ('1@2000-01-01'),('5@2000-01-02')) t(v); +SELECT AppendInstant(v::tint)::VARCHAR FROM (VALUES ('1@2000-01-01'),('5@2000-01-02')) t(v); ---- [1@2000-01-01 00:00:00+01, 5@2000-01-02 00:00:00+01] query I -SELECT AppendSequenceAgg(v::tint)::VARCHAR FROM (VALUES +SELECT AppendSequence(v::tint)::VARCHAR FROM (VALUES ('[1@2000-01-01, 2@2000-01-02]'::tint), ('[5@2000-01-04, 6@2000-01-05]')) t(v); ---- {[1@2000-01-01 00:00:00+01, 2@2000-01-02 00:00:00+01], [5@2000-01-04 00:00:00+01, 6@2000-01-05 00:00:00+01]} # ============================================================================= -# SpanUnionAgg / SetUnionAgg +# SpanUnion / SetUnion # ============================================================================= query I -SELECT SpanUnionAgg(s::intspan)::VARCHAR FROM (VALUES ('[1, 5)'), ('[3, 8)')) t(s); +SELECT SpanUnion(s::intspan)::VARCHAR FROM (VALUES ('[1, 5)'), ('[3, 8)')) t(s); ---- {[1, 8)} query I -SELECT SpanUnionAgg(s::intspanset)::VARCHAR FROM (VALUES +SELECT SpanUnion(s::intspanset)::VARCHAR FROM (VALUES ('{[1, 3), [5, 7)}'), ('{[10, 15)}')) t(s); ---- {[1, 3), [5, 7), [10, 15)} query I -SELECT SetUnionAgg(v::int)::VARCHAR FROM (VALUES (1), (3), (5), (3)) t(v); +SELECT SetUnion(v::int)::VARCHAR FROM (VALUES (1), (3), (5), (3)) t(v); ---- {1, 3, 5} query I -SELECT SetUnionAgg(v::intset)::VARCHAR FROM (VALUES ('{1, 3}'::intset), ('{2, 4}')) t(v); +SELECT SetUnion(v::intset)::VARCHAR FROM (VALUES ('{1, 3}'::intset), ('{2, 4}')) t(v); ---- {1, 2, 3, 4} query I -SELECT SetUnionAgg(d::date)::VARCHAR FROM (VALUES ('2001-01-01'::date), ('2001-01-03')) t(d); +SELECT SetUnion(d::date)::VARCHAR FROM (VALUES ('2001-01-01'::date), ('2001-01-03')) t(d); ---- {2001-01-01, 2001-01-03} # ============================================================================= -# Window aggregates: WminAgg / WmaxAgg / WsumAgg / WcountAgg / WavgAgg +# Window aggregates: Wmin / Wmax / Wsum / Wcount / Wavg # ============================================================================= query I -SELECT WminAgg(v::tint, INTERVAL '2 days')::VARCHAR FROM (VALUES ('1@2000-01-01'),('5@2000-01-02'),('3@2000-01-04')) t(v); +SELECT Wmin(v::tint, INTERVAL '2 days')::VARCHAR FROM (VALUES ('1@2000-01-01'),('5@2000-01-02'),('3@2000-01-04')) t(v); ---- {[1@2000-01-01 00:00:00+01, 1@2000-01-03 00:00:00+01], (5@2000-01-03 00:00:00+01, 3@2000-01-04 00:00:00+01, 3@2000-01-06 00:00:00+01]} query I -SELECT WmaxAgg(v::tfloat, INTERVAL '2 days')::VARCHAR FROM (VALUES ('1.5@2000-01-01'),('5.5@2000-01-02')) t(v); +SELECT Wmax(v::tfloat, INTERVAL '2 days')::VARCHAR FROM (VALUES ('1.5@2000-01-01'),('5.5@2000-01-02')) t(v); ---- {[1.5@2000-01-01 00:00:00+01, 1.5@2000-01-02 00:00:00+01), [5.5@2000-01-02 00:00:00+01, 5.5@2000-01-04 00:00:00+01]} query I -SELECT WsumAgg(v::tint, INTERVAL '2 days')::VARCHAR FROM (VALUES ('1@2000-01-01'),('5@2000-01-02')) t(v); +SELECT Wsum(v::tint, INTERVAL '2 days')::VARCHAR FROM (VALUES ('1@2000-01-01'),('5@2000-01-02')) t(v); ---- {[1@2000-01-01 00:00:00+01, 6@2000-01-02 00:00:00+01, 6@2000-01-03 00:00:00+01], (5@2000-01-03 00:00:00+01, 5@2000-01-04 00:00:00+01]} query I -SELECT WavgAgg(v::tint, INTERVAL '2 days')::VARCHAR FROM (VALUES ('2@2000-01-01'),('4@2000-01-02')) t(v); +SELECT Wavg(v::tint, INTERVAL '2 days')::VARCHAR FROM (VALUES ('2@2000-01-01'),('4@2000-01-02')) t(v); ---- Interp=Step;{[2@2000-01-01 00:00:00+01, 3@2000-01-02 00:00:00+01, 3@2000-01-03 00:00:00+01], (4@2000-01-03 00:00:00+01, 4@2000-01-04 00:00:00+01]} @@ -232,11 +232,11 @@ Interp=Step;{[2@2000-01-01 00:00:00+01, 3@2000-01-02 00:00:00+01, 3@2000-01-03 0 # ============================================================================= query I -SELECT TandAgg(v::tbool)::VARCHAR FROM (VALUES (NULL::VARCHAR)) t(v) WHERE v IS NOT NULL; +SELECT Tand(v::tbool)::VARCHAR FROM (VALUES (NULL::VARCHAR)) t(v) WHERE v IS NOT NULL; ---- NULL query I -SELECT TcountAgg(v::tint)::VARCHAR FROM (VALUES ('1@2000-01-01'),(NULL),('5@2000-01-02')) t(v); +SELECT Tcount(v::tint)::VARCHAR FROM (VALUES ('1@2000-01-01'),(NULL),('5@2000-01-02')) t(v); ---- {1@2000-01-01 00:00:00+01, 1@2000-01-02 00:00:00+01} diff --git a/test/sql/parity/040_temporal_aggfuncs.test b/test/sql/parity/040_temporal_aggfuncs.test index fbad0edd..1b9f7ead 100644 --- a/test/sql/parity/040_temporal_aggfuncs.test +++ b/test/sql/parity/040_temporal_aggfuncs.test @@ -2,9 +2,9 @@ # description: MobilityDB regression file 040_temporal_aggfuncs.test.sql adapted for MobilityDuck # group: [sql] # -# Per-temporal-type aggregate manifest using RFC #827 Pascal-cased *Agg names. +# Per-temporal-type aggregate manifest. Aggregate names match MobilityDB. # Notes on expected outputs vs MobilityDB upstream: -# - TcountAgg / TminAgg / TsumAgg over TInstants at distinct timestamps return +# - Tcount / Tmin / Tsum over TInstants at distinct timestamps return # one output instant per input (no overlap → each instant is its own group). # MobilityDB's `tcount`/`tmin`/`tsum` produce step sequences spanning the # full temporal extent; MobilityDuck's skiplist aggregates emit discrete @@ -13,22 +13,22 @@ require mobilityduck query I -SELECT TcountAgg(temp::tint)::VARCHAR FROM (VALUES ('1@2000-01-01'), ('2@2000-01-02')) t(temp); +SELECT Tcount(temp::tint)::VARCHAR FROM (VALUES ('1@2000-01-01'), ('2@2000-01-02')) t(temp); ---- {1@2000-01-01 00:00:00+01, 1@2000-01-02 00:00:00+01} query I -SELECT TandAgg(temp::tbool)::VARCHAR FROM (VALUES ('t@2000-01-01'), ('f@2000-01-02')) t(temp); +SELECT Tand(temp::tbool)::VARCHAR FROM (VALUES ('t@2000-01-01'), ('f@2000-01-02')) t(temp); ---- {t@2000-01-01 00:00:00+01, f@2000-01-02 00:00:00+01} query I -SELECT TminAgg(temp::tint)::VARCHAR FROM (VALUES ('3@2000-01-01'), ('1@2000-01-02')) t(temp); +SELECT Tmin(temp::tint)::VARCHAR FROM (VALUES ('3@2000-01-01'), ('1@2000-01-02')) t(temp); ---- {3@2000-01-01 00:00:00+01, 1@2000-01-02 00:00:00+01} query I -SELECT TsumAgg(temp::tint)::VARCHAR FROM (VALUES ('1@2000-01-01'), ('2@2000-01-02')) t(temp); +SELECT Tsum(temp::tint)::VARCHAR FROM (VALUES ('1@2000-01-01'), ('2@2000-01-02')) t(temp); ---- {1@2000-01-01 00:00:00+01, 2@2000-01-02 00:00:00+01} diff --git a/test/sql/parity/040_tgeometry_parity.test b/test/sql/parity/040_tgeometry_parity.test index 219be30f..c16e36fd 100644 --- a/test/sql/parity/040_tgeometry_parity.test +++ b/test/sql/parity/040_tgeometry_parity.test @@ -312,7 +312,7 @@ SELECT (traversedArea(t::tgeometry) IS NOT NULL) FROM (VALUES true # ============================================================================= -# Aggregate wiring — extent / TcountAgg / MergeAgg / AppendInstantAgg over +# Aggregate wiring — extent / Tcount / Merge / AppendInstant over # tgeometry inputs. # ============================================================================= @@ -323,19 +323,19 @@ SELECT extent(t::tgeometry)::VARCHAR FROM (VALUES STBOX XT(((0,0),(2,2)),[2000-01-01 00:00:00+01, 2000-01-02 00:00:00+01]) query I -SELECT TcountAgg(t::tgeometry)::VARCHAR FROM (VALUES +SELECT Tcount(t::tgeometry)::VARCHAR FROM (VALUES ('Point(0 0)@2000-01-01'), ('Point(2 2)@2000-01-02')) t(t); ---- {1@2000-01-01 00:00:00+01, 1@2000-01-02 00:00:00+01} query I -SELECT (MergeAgg(t::tgeometry) IS NOT NULL) FROM (VALUES +SELECT (Merge(t::tgeometry) IS NOT NULL) FROM (VALUES ('Point(0 0)@2000-01-01'), ('Point(2 2)@2000-01-02')) t(t); ---- true query I -SELECT (AppendInstantAgg(t::tgeometry) IS NOT NULL) FROM (VALUES +SELECT (AppendInstant(t::tgeometry) IS NOT NULL) FROM (VALUES ('Point(0 0)@2000-01-01'), ('Point(2 2)@2000-01-02')) t(t); ---- true diff --git a/test/sql/parity/041_tgeography_parity.test b/test/sql/parity/041_tgeography_parity.test index e53e5657..721ec00d 100644 --- a/test/sql/parity/041_tgeography_parity.test +++ b/test/sql/parity/041_tgeography_parity.test @@ -144,19 +144,19 @@ SELECT extent(t::tgeography)::VARCHAR FROM (VALUES SRID=4326;GEODSTBOX XT(((0,0),(2,2)),[2000-01-01 00:00:00+01, 2000-01-02 00:00:00+01]) query I -SELECT TcountAgg(t::tgeography)::VARCHAR FROM (VALUES +SELECT Tcount(t::tgeography)::VARCHAR FROM (VALUES ('Point(0 0)@2000-01-01'), ('Point(2 2)@2000-01-02')) t(t); ---- {1@2000-01-01 00:00:00+01, 1@2000-01-02 00:00:00+01} query I -SELECT (MergeAgg(t::tgeography) IS NOT NULL) FROM (VALUES +SELECT (Merge(t::tgeography) IS NOT NULL) FROM (VALUES ('Point(0 0)@2000-01-01'), ('Point(2 2)@2000-01-02')) t(t); ---- true query I -SELECT (AppendInstantAgg(t::tgeography) IS NOT NULL) FROM (VALUES +SELECT (AppendInstant(t::tgeography) IS NOT NULL) FROM (VALUES ('Point(0 0)@2000-01-01'), ('Point(2 2)@2000-01-02')) t(t); ---- true diff --git a/test/sql/parity/042_temporal_waggfuncs.test b/test/sql/parity/042_temporal_waggfuncs.test index 6f2935ae..0f2f7853 100644 --- a/test/sql/parity/042_temporal_waggfuncs.test +++ b/test/sql/parity/042_temporal_waggfuncs.test @@ -2,15 +2,15 @@ # description: MobilityDB regression file 042_temporal_waggfuncs.test.sql adapted for MobilityDuck # group: [sql] # -# Windowed temporal aggregates (WminAgg, WmaxAgg, WsumAgg, WavgAgg) over a -# fixed-width interval window. RFC #827 Pascal-cased names. +# Windowed temporal aggregates (Wmin, Wmax, Wsum, Wavg) over a +# fixed-width interval window. Names match MobilityDB SQL. # -# WcountAgg: tnumber_wcount_transfn is absent from the pinned MEOS commit +# Wcount: tnumber_wcount_transfn is absent from the pinned MEOS commit # (f11b7443e); that overload is omitted and tracked for re-activation when # MEOS is bumped. # -# Window aggregates over TSequence input: MobilityDuck's WminAgg/WmaxAgg/ -# WsumAgg with a single-row TSequence input produce a constant-value result +# Window aggregates over TSequence input: MobilityDuck's Wmin/Wmax/ +# Wsum with a single-row TSequence input produce a constant-value result # (first value extended to end+duration). This matches MEOS's SkipList window # accumulator behaviour for a single TSequence row; the per-instant case is # verified in 031_aggregates_skiplist.test. @@ -18,16 +18,16 @@ require mobilityduck query I -SELECT WminAgg(temp::tint, INTERVAL '1 day')::VARCHAR FROM (VALUES ('[1@2000-01-01, 5@2000-01-05]')) t(temp); +SELECT Wmin(temp::tint, INTERVAL '1 day')::VARCHAR FROM (VALUES ('[1@2000-01-01, 5@2000-01-05]')) t(temp); ---- {[1@2000-01-01 00:00:00+01, 1@2000-01-06 00:00:00+01]} query I -SELECT WmaxAgg(temp::tint, INTERVAL '1 day')::VARCHAR FROM (VALUES ('[1@2000-01-01, 5@2000-01-05]')) t(temp); +SELECT Wmax(temp::tint, INTERVAL '1 day')::VARCHAR FROM (VALUES ('[1@2000-01-01, 5@2000-01-05]')) t(temp); ---- {[1@2000-01-01 00:00:00+01, 1@2000-01-06 00:00:00+01]} query I -SELECT WsumAgg(temp::tint, INTERVAL '1 day')::VARCHAR FROM (VALUES ('[1@2000-01-01, 5@2000-01-05]')) t(temp); +SELECT Wsum(temp::tint, INTERVAL '1 day')::VARCHAR FROM (VALUES ('[1@2000-01-01, 5@2000-01-05]')) t(temp); ---- {[1@2000-01-01 00:00:00+01, 1@2000-01-06 00:00:00+01]} diff --git a/test/sql/parity/042_tgeogpoint_parity.test b/test/sql/parity/042_tgeogpoint_parity.test index 7ba3879f..6eefaca5 100644 --- a/test/sql/parity/042_tgeogpoint_parity.test +++ b/test/sql/parity/042_tgeogpoint_parity.test @@ -137,25 +137,25 @@ SELECT extent(t::tgeogpoint)::VARCHAR FROM (VALUES SRID=4326;GEODSTBOX XT(((0,0),(2,2)),[2000-01-01 00:00:00+01, 2000-01-02 00:00:00+01]) query I -SELECT TcountAgg(t::tgeogpoint)::VARCHAR FROM (VALUES +SELECT Tcount(t::tgeogpoint)::VARCHAR FROM (VALUES ('Point(0 0)@2000-01-01'), ('Point(2 2)@2000-01-02')) t(t); ---- {1@2000-01-01 00:00:00+01, 1@2000-01-02 00:00:00+01} query I -SELECT (MergeAgg(t::tgeogpoint) IS NOT NULL) FROM (VALUES +SELECT (Merge(t::tgeogpoint) IS NOT NULL) FROM (VALUES ('Point(0 0)@2000-01-01'), ('Point(2 2)@2000-01-02')) t(t); ---- true query I -SELECT (AppendInstantAgg(t::tgeogpoint) IS NOT NULL) FROM (VALUES +SELECT (AppendInstant(t::tgeogpoint) IS NOT NULL) FROM (VALUES ('Point(0 0)@2000-01-01'), ('Point(2 2)@2000-01-02')) t(t); ---- true query I -SELECT (TcentroidAgg(t::tgeogpoint) IS NOT NULL) FROM (VALUES +SELECT (Tcentroid(t::tgeogpoint) IS NOT NULL) FROM (VALUES ('Point(0 0)@2000-01-01'), ('Point(2 2)@2000-01-02')) t(t); ---- true