feat(bindings): ever/always ordering (lt, le, gt, ge) — named functions#35
Closed
estebanzimanyi wants to merge 1 commit into
Closed
feat(bindings): ever/always ordering (lt, le, gt, ge) — named functions#35estebanzimanyi wants to merge 1 commit into
estebanzimanyi wants to merge 1 commit into
Conversation
Adds 48 ScalarFunction registrations covering the temporal-comparison
ever/always ordering surface for tint / tfloat (no tbool — booleans
have no ordering):
ever_lt, always_lt, ever_le, always_le,
ever_gt, always_gt, ever_ge, always_ge
× value op temporal, temporal op value, temporal op temporal
× {int/tint, double/tfloat}
DuckDB's parser does not accept `?` or `#` as operator-name
characters, so the upstream MobilityDB operators (?<, ?<=, ?>, ?>=,
#<, #<=, #>, #>=) are unreachable from SQL — these named functions
provide equivalent behaviour.
Backed by 40 wrapper functions (8 named functions × 5 type-pair
shapes) generated via a DEFINE_EA_ORD_OP macro, reusing the
EverAlwaysValTemp / EverAlwaysTempVal / EverAlwaysTempTemp helpers
from the eq+ne PR.
Smoke test:
SELECT ever_lt(tint '[1@01-01, 5@01-05]', 3); -- true
SELECT always_lt(tint '[1@01-01, 2@01-02]', 3); -- true
SELECT ever_le(0, tint '[1@01-01, 2@01-02]'); -- true
SELECT always_ge(tint '[5@01-01, 10@01-05]', 5); -- true
SELECT ever_gt(tfloat '[1.5@01-01, 2.5@01-02]', 2.0::DOUBLE); -- true
Stacked on PR #34 (ever/always eq+ne).
Full suite passes (747 assertions, 13 test cases).
This was referenced Apr 25, 2026
estebanzimanyi
added a commit
that referenced
this pull request
Apr 25, 2026
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).
3 tasks
Member
Author
|
Consolidated into #41 (ever/always comparison predicates — eq/ne/ord combined). |
estebanzimanyi
added a commit
that referenced
this pull request
Apr 25, 2026
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).
estebanzimanyi
added a commit
that referenced
this pull request
Apr 25, 2026
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).
estebanzimanyi
added a commit
that referenced
this pull request
Apr 27, 2026
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).
nhungoc1508
pushed a commit
that referenced
this pull request
Apr 27, 2026
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).
nhungoc1508
pushed a commit
that referenced
this pull request
Apr 27, 2026
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).
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 48 ScalarFunction registrations covering the temporal-comparison ever/always ordering surface for
tint/tfloat(notbool— booleans have no ordering).ever_lt,always_lt,ever_le,always_le,ever_gt,always_gt,ever_ge,always_geDuckDB's parser does not accept
?or#as operator-name characters, so the upstream MobilityDB operators (?<,?<=,?>,?>=,#<,#<=,#>,#>=) are unreachable from SQL — these named functions provide equivalent behaviour.Implementation
DEFINE_EA_ORD_OPmacro.EverAlwaysValTemp/EverAlwaysTempVal/EverAlwaysTempTemphelpers + 1 macro added in PR feat(bindings): ever/always equality and inequality (eq, ne) — named functions #34 (eq+ne).Smoke test
Test plan
make releasethenTZ=UTC ./build/release/test/unittest "<proj>/test/*"— full suite passes.030_temporal_compops.testskip block fully unwraps for tnumber types when re-pointed from?</#<etc. to the equivalent named functions. ttext ordering stays a separate follow-up.Dependencies
Stacked on PR #34 (ever/always eq+ne). Merge order: #27 → #29 → #30 → #31 → #32 → #33 → #34 → this.