feat(bindings): tspatial comparison predicates — ever/always + temporal_teq/tne#76
Closed
estebanzimanyi wants to merge 1 commit intomainfrom
Closed
feat(bindings): tspatial comparison predicates — ever/always + temporal_teq/tne#76estebanzimanyi wants to merge 1 commit intomainfrom
estebanzimanyi wants to merge 1 commit intomainfrom
Conversation
…al_teq/tne
Closes 100% of geo/054_tpoint_compops by name. Implements the spatial
comparison handlers that were previously declared as TODO in the
TgeompointFunctions header.
New handlers (16 total, two macro-driven blocks in tgeompoint_functions.cpp):
ever/always (returning bool):
- {Ever,Always}_{eq,ne}_{geo_tgeo, tgeo_geo, tgeo_tgeo} (12)
temporal_teq / temporal_tne (returning tbool):
- {Teq,Tne}_{geo_tgeo, tgeo_geo, tgeo_tgeo} (6, including tgeo_tgeo
reusing teq_temporal_temporal /
tne_temporal_temporal MEOS exports)
The previously-declared Teq_temporal_temporal / Tne_temporal_temporal
in the TgeompointFunctions namespace become thin forwarders to the new
Teq_tgeo_tgeo / Tne_tgeo_tgeo (so existing references stay valid).
Registrations in tgeompoint.cpp (24 total via REG_SPATIAL_EA / REG_SPATIAL_TCMP
macros):
- ever_eq / always_eq / ever_ne / always_ne for (geometry × tgeompoint),
(tgeompoint × geometry), (tgeompoint × tgeompoint).
- temporal_teq / temporal_tne for the same shape.
MobilityDB also exposes the operator forms `?=` / `?<>` / `#=` / `#<>` for
these; DuckDB's parser does not accept multi-character operator tokens
starting with `?` or `#`, so only the named functions are registered.
Test: test/sql/parity/054_tspatial_compops.test (9 assertions covering
each ever/always op in all three directions and temporal_teq/tne returning
the expected tbool sequenceset).
Full suite: 761 / 14 cases under TZ=UTC.
Files also gain a trailing newline at EOF.
Member
Author
|
Superseded by the consolidated PR branch |
2 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.
Closes 100% of `geo/054_tpoint_compops` by name. Implements the spatial comparison handlers that were previously declared as TODO in `TgeompointFunctions`.
New SQL surface
ever / always (returning bool)
12 ever/always registrations.
temporal_teq / temporal_tne (returning tbool)
6 temporal_teq/tne registrations.
Implementation
Two macros (`DEFINE_EA_GEO_TGEO`, `DEFINE_TCMP_GEO_TGEO`) factor the boilerplate; each produces a 3-handler block (`_geo_tgeo`, `_tgeo_geo`, `*_tgeo_tgeo`). The (tgeo, tgeo) variant reuses MEOS `teq_temporal_temporal` / `tne_temporal_temporal` exports rather than introducing a separate `teq_tgeo_tgeo` MEOS function. Previously-declared `Teq_temporal_temporal` / `Tne_temporal_temporal` in the TgeompointFunctions namespace become thin forwarders to the new `Teq_tgeo_tgeo` / `Tne_tgeo_tgeo` so existing references stay valid.
Registration in `tgeompoint.cpp` uses parallel `REG_SPATIAL_EA` / `REG_SPATIAL_TCMP` macros for the 24 total registrations.
Operator forms not registered
MobilityDB also exposes `?=` / `?<>` / `#=` / `#<>` for these. DuckDB's parser does not accept multi-character operator tokens starting with `?` or `#`, so only named functions are registered. This is consistent with PR #73 (`temporal_teq/tne` on tnumber/tbool/ttext) and PR #74 (temporal position predicates).
Tests
Coverage delta
Per the audit in PR #66:
Test plan