feat(bindings): tspatial topological predicates — operators + named aliases#75
Closed
estebanzimanyi wants to merge 1 commit into
Closed
feat(bindings): tspatial topological predicates — operators + named aliases#75estebanzimanyi wants to merge 1 commit into
estebanzimanyi wants to merge 1 commit into
Conversation
…liases
Adds 5 topological predicates across the tspatial × {stbox, tspatial}
surface, both as @>/<@/&&/~=/-|- operators and as MobilityDB-canonical
named-function aliases (temporal_contains/contained/overlaps/same/
adjacent).
New handlers in StboxFunctions (15 total):
- Contains/Contained/Overlaps/Same/Adjacent _tspatial_stbox
- Contains/Contained/Overlaps/Same/Adjacent _stbox_tspatial
- Contains/Contained/Overlaps/Same/Adjacent _tspatial_tspatial
Each routes to the matching MEOS export
(contains_tspatial_stbox / contains_stbox_tspatial /
contains_tspatial_tspatial, etc.). A DEFINE_TSPATIAL_TOPO macro
factors the boilerplate.
Registered for tgeompoint × {stbox, tgeompoint}; a parallel REG_TSPATIAL_TOPO
macro in stbox.cpp emits the operator + named-alias pair for each
(L, R, FN_SUFFIX) triple. tgeometry overloads stay pending until the
wider tgeometry scalar surface lands.
Also closes the long-standing temporal_same gap: the Same handler now
exists for tspatial pairs, and the temporal/032_temporal_boxops PR #72
already documented the deferral. Once both lands, ~= / temporal_same
on stbox-stbox already works (existing wiring in stbox.cpp).
Test: test/sql/parity/060_tspatial_topops.test (9 assertions covering
each of the 5 ops in both directions plus operator-vs-alias
equivalence).
Full suite: 761 / 14 cases under TZ=UTC.
Files also gain a trailing newline at EOF.
This was referenced Apr 30, 2026
Member
Author
|
Superseded by the consolidated PR branch |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the 5 topological predicates across the `tspatial × {stbox, tspatial}` surface that previously had no handlers in MobilityDuck.
New SQL surface
Five predicates: `contains` / `contained` / `overlaps` / `same` / `adjacent`. Each is registered both as the operator form and as the MobilityDB-canonical named-function alias.
Coverage:
That's 5 ops × 2 names × 3 type-pairs = 30 new registrations plus 15 new handler functions.
Implementation
Three new handler families per op, each calling the matching MEOS export (`contains_tspatial_stbox` / `contains_stbox_tspatial` / `contains_tspatial_tspatial`, ditto for contained/overlaps/same/adjacent). A `DEFINE_TSPATIAL_TOPO` macro in `stbox_functions.cpp` factors the boilerplate; a parallel `REG_TSPATIAL_TOPO` macro in `stbox.cpp` emits the operator + named-alias pair for each `(L, R, FN_SUFFIX)` triple.
Closes the temporal_same gap
PR #72 (`temporal/032_temporal_boxops`) deferred `temporal_same` because the underlying `Same_*` handler family wasn't wired. This PR adds them on the tspatial side. The `stbox × stbox` `
=` operator was already wired (with `Same_stbox_stbox`); the `temporal × temporal` and `tnumber × {numspan, tbox}` `=` cases stay deferred — separate small follow-up.Tests
Coverage delta
Per the audit in PR #66:
Test plan