feat(bindings): temporal topological predicates (@>, <@, &&, -|-) — 96 registrations#32
Closed
estebanzimanyi wants to merge 1 commit intofeat/tnumber-distancefrom
Closed
feat(bindings): temporal topological predicates (@>, <@, &&, -|-) — 96 registrations#32estebanzimanyi wants to merge 1 commit intofeat/tnumber-distancefrom
estebanzimanyi wants to merge 1 commit intofeat/tnumber-distancefrom
Conversation
Adds 96 ScalarFunction registrations covering the temporal-side
topological operator surface, backed by 12 wrapper implementations.
Coverage:
- temporal × temporal (16 = 4 ops × 4×4 type pairs)
Uses MEOS contains/contained/overlaps/adjacent_temporal_temporal
(one polymorphic function each, dispatching internally on the
temporal subtype).
- temporal × tstzspan (16 = 4 ops × 4 temporal types × 1 span type)
Uses MEOS contains/contained/overlaps/adjacent_temporal_tstzspan.
- tstzspan × temporal (16 = 4 ops × 4 temporal types, reverse direction)
MEOS only exposes the temporal-span direction, so the reverse
registrations swap arg order and use the inverse op
(contains <-> contained), so for example
`tstzspan @> temporal` calls `contained_temporal_tstzspan(t, s)`.
- All 4 temporal types (tbool, tint, tfloat, ttext) × all 4 ops.
Three small templated helpers added (TempTempBoolPred,
TempSpanBoolPred, SpanTempBoolPred) to keep each ScalarFunction body
to one line.
Smoke test:
SELECT tint '[1@01-01, 5@01-05]' @> tint '[3@01-02, 4@01-04]'; -- true
SELECT tint '[3@01-02, 4@01-04]' <@ tint '[1@01-01, 5@01-05]'; -- true
SELECT tint '[1@01-01, 5@01-05]' && tint '[3@01-03, 7@01-07]'; -- true
SELECT tint '[1@01-01, 5@01-05]' @> tstzspan '[01-02, 01-04]'; -- true
SELECT tstzspan '[01-01, 01-10]' @> tint '[2@01-02, 4@01-04]'; -- true
Stacked on PR #31 (tnumber distance).
Full suite passes (747 assertions, 13 test cases).
This was referenced Apr 25, 2026
Member
Author
|
Consolidated into #42 (temporal time-domain predicates — topo + position combined). |
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.
Summary
Adds 96 ScalarFunction registrations covering the temporal-side topological-operator surface, backed by 12 wrapper implementations:
contains/contained/overlaps/adjacent_temporal_temporalcontains/contained/overlaps/adjacent_temporal_tstzspantstzspan @> temporal→contained_temporal_tstzspan(t, s))All four temporal types (tbool, tint, tfloat, ttext) × all four operators (
@>,<@,&&,-|-).Three small templated helpers added (
TempTempBoolPred,TempSpanBoolPred,SpanTempBoolPred) to keep each ScalarFunction body to one line.Smoke test
Test plan
make releasethenTZ=UTC ./build/release/test/unittest "<proj>/test/*"— full suite passes.032_temporal_topops.testskip block partially unwraps. The remaining unbound surface is the value-temporal direction (temporal @> value/value <@ temporal) and thetnumber × {numspan, tbox}set — separate follow-ups.Dependencies
Stacked on PR #31 (tnumber distance). Merge order: #27 → #29 → #30 → #31 → this.