feat(bindings): temporal similarity measures (Frechet, DTW, Hausdorff)#36
Merged
nhungoc1508 merged 1 commit intoApr 27, 2026
Conversation
This was referenced Apr 25, 2026
23be6de to
23672e8
Compare
4dbe1cc to
fed1b76
Compare
23672e8 to
f174c9c
Compare
fed1b76 to
daf649a
Compare
f174c9c to
b2685bb
Compare
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).
b2685bb to
3291822
Compare
2cc6373
into
feat/temporal-everalways-comparisons
3 checks passed
Member
Author
|
@nhungoc1508 — heads up: this PR is marked merged but its content did not reach PR #41's branch now carries this commit. When PR #41 lands in If you want a clean attribution: I can re-PR PR #36's content as a separate PR rooted on main, after PR #41 lands. Otherwise it's fine to let the combined squash carry both. |
3 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.
Summary
Adds 8 ScalarFunction registrations for temporal similarity measures:
frechetDistance(t1, t2)temporal_frechet_distancediscreteFrechet(t1, t2)temporal_frechet_distance(alias)dynTimeWarp(t1, t2)temporal_dyntimewarp_distancehausdorffDistance(t1, t2)temporal_hausdorff_distanceFor each:
(tint, tint)and(tfloat, tfloat)registrations.Implementation uses 3 thin wrappers + a single
TempTempDoublePredtemplated helper.similarityPath(table-returning, alignment) is intentionally NOT included — needs DuckDBTableFunctioninfrastructure (separate follow-up tracked in PR #23).Smoke test
Test plan
make releasethenTZ=UTC ./build/release/test/unittest "<proj>/test/*"— full suite passes.038_temporal_similarity.testskip block partially unwraps (the scalar measures activate;similarityPathstays gated on TableFunction infra).Dependencies
Stacked on PR #35 (ever/always ordering). Merge order: #27 → #29 → #30 → #31 → #32 → #33 → #34 → #35 → this.