feat(bindings): ever/always comparison predicates (eq, ne, lt, le, gt, ge)#41
Closed
estebanzimanyi wants to merge 2 commits intofeat/temporal-time-domain-predicatesfrom
Closed
Conversation
This was referenced Apr 25, 2026
4dbe1cc to
fed1b76
Compare
c4513da to
cf03319
Compare
fed1b76 to
daf649a
Compare
cf03319 to
152ec24
Compare
…, ge) Adds ever/always comparison predicates between Temporal values and base scalars across all 6 comparison ops × 6 base types (int, bigint, float, text, geometry, geography where applicable). Uses the EverAlwaysValTemp<T> templated helper. Functions are exposed as named SQL forms (`ever_eq`, `always_eq`, `ever_ne`, `always_ne`, `ever_lt`, `always_lt`, `ever_le`, `always_le`, `ever_gt`, `always_gt`, `ever_ge`, `always_ge`) — DuckDB's parser does not accept the MobilityDB `?=`, `%=`, `?<`, `%<`, etc. operator forms.
daf649a to
070e31a
Compare
Adds 8 ScalarFunction registrations for temporal similarity: frechetDistance(t1, t2) -> DOUBLE discreteFrechet(t1, t2) -> DOUBLE (alias of frechetDistance) dynTimeWarp(t1, t2) -> DOUBLE hausdorffDistance(t1, t2) -> DOUBLE For each: (tint, tint) and (tfloat, tfloat) registrations. MEOS bindings: temporal_frechet_distance, temporal_dyntimewarp_distance, temporal_hausdorff_distance. Implementation uses 3 thin wrappers + a single TempTempDoublePred templated helper. similarityPath (table-returning, alignment) is intentionally NOT included — needs DuckDB TableFunction infrastructure (separate follow-up tracked in PR #23). Smoke test: SELECT frechetDistance(tfloat '[1@01-01, 2@01-02]', tfloat '[2@01-01, 3@01-02]'); -- 1.0 SELECT discreteFrechet(tfloat '[1@01-01, 2@01-02]', tfloat '[2@01-01, 3@01-02]'); -- 1.0 SELECT dynTimeWarp(tfloat '[1@01-01, 2@01-02]', tfloat '[2@01-01, 3@01-02]'); -- 2.0 SELECT hausdorffDistance(tfloat '[1@01-01, 5@01-05]', tfloat '[3@01-01, 3@01-05]'); -- 2.0 Stacked on PR #35 (ever/always ordering). Full suite passes (747 assertions, 13 test cases).
Member
Author
|
@nhungoc1508 — quick note for review: this branch now carries two PRs' worth of content stacked:
When you squash-merge this PR into For future PRs in the binding stack, please update each PR's base to |
Member
Author
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
Combines ever/always equality, inequality, and ordering predicates between Temporal values and base scalars across all 6 comparison ops × applicable base types. 232 lines, all routed through the
EverAlwaysValTemp<T>templated helper.This PR consolidates two previously stacked PRs covering the same surface across the same template — splitting eq/ne from ord added review burden without giving reviewers any independent decision points.
Coverage
ever_eq(t, v),always_eq(t, v),ever_ne(t, v),always_ne(t, v)ever_lt,always_lt,ever_le,always_le,ever_gt,always_gt,ever_ge,always_geFunctions are exposed as named SQL forms because DuckDB's parser does not accept the MobilityDB
?=,%=,?<,%<, etc. operator forms.Test plan
Replaces