feat(bindings): temporal time-position predicates (before, after, overbefore, overafter)#33
Closed
estebanzimanyi wants to merge 1 commit intofeat/temporal-topopsfrom
Closed
feat(bindings): temporal time-position predicates (before, after, overbefore, overafter)#33estebanzimanyi wants to merge 1 commit intofeat/temporal-topopsfrom
estebanzimanyi wants to merge 1 commit intofeat/temporal-topopsfrom
Conversation
…rbefore, overafter) Adds 96 ScalarFunction registrations for temporal time-position predicates as named functions (DuckDB's parser does not accept `#` as an operator-name character, so the upstream MobilityDB operators `<<#`, `#>>`, `&<#`, `#&>` cannot be reached from SQL — the named forms `before` / `after` / `overbefore` / `overafter` provide equivalent behaviour). Coverage: - temporal × temporal (4 ops × 4×4 type pairs = 64) - temporal × tstzspan (4 ops × 4 temporal types × 1 span = 16) - tstzspan × temporal (4 ops × 4 reverse direction = 16) Backed by 12 wrapper functions reusing the TempTempBoolPred / TempSpanBoolPred / SpanTempBoolPred templated helpers from the topological-predicates PR. Reverse-direction (`tstzspan op temporal`): MEOS only exposes the temporal-span direction, so the reverse calls swap arg order and use the inverse op: span before temporal -> after_temporal_tstzspan(t, s) span after temporal -> before_temporal_tstzspan(t, s) span overbefore temp -> overafter_temporal_tstzspan(t, s) span overafter temp -> overbefore_temporal_tstzspan(t, s) Smoke test: SELECT before(tint '[1@01-01, 2@01-02]', tint '[3@01-05, 4@01-06]'); -- true SELECT after (tint '[3@01-05, 4@01-06]', tint '[1@01-01, 2@01-02]'); -- true SELECT overbefore(tint '[1@01-01, 2@01-02]', tint '[2@01-02, 3@01-03]'); -- true SELECT before(tint '[1@01-01, 5@01-05]', tstzspan '[01-08, 01-10]'); -- true SELECT after (tstzspan '[01-01, 01-03]', tint '[5@01-05, 6@01-06]'); -- false Stacked on PR #32 (temporal topops). 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 for temporal time-position predicates as named functions. DuckDB's parser does not accept
#as an operator-name character, so the upstream MobilityDB operators<<#,#>>,&<#,#&>cannot be reached from SQL — the named formsbefore/after/overbefore/overafterprovide equivalent behaviour.before/after/overbefore/overafter_temporal_temporalbefore/after/overbefore/overafter_temporal_tstzspanBacked by 12 wrapper functions reusing
TempTempBoolPred/TempSpanBoolPred/SpanTempBoolPredfrom PR #32.For reverse direction, MEOS only exposes the temporal-span variant; the reverse calls swap arg order and use the inverse op (
span before temporal→after_temporal_tstzspan(t, s), etc.).Smoke test
Test plan
make releasethenTZ=UTC ./build/release/test/unittest "<proj>/test/*"— full suite passes.034_temporal_posops.testskip block partially unwraps for the time-position subset. The spatial-side<</>>/&</&>(parseable by DuckDB) and value-temporal direction stay separate follow-ups.Dependencies
Stacked on PR #32 (temporal topological predicates). Merge order: #27 → #29 → #30 → #31 → #32 → this.