feat(bindings): tspatial position predicates — temporal_* aliases + time-axis#77
Closed
estebanzimanyi wants to merge 1 commit into
Closed
feat(bindings): tspatial position predicates — temporal_* aliases + time-axis#77estebanzimanyi wants to merge 1 commit into
estebanzimanyi wants to merge 1 commit into
Conversation
…ime-axis
Closes 100% of geo/062_tpoint_posops by name. The 12 spatial-axis
predicates (left/right/below/above/front/back + over* variants) were
already wired with operator/named forms; this batch:
1. Adds the MobilityDB-canonical `temporal_*` named aliases registered
against the same handlers as the existing operator/named forms.
2. Adds 12 new handlers for time-axis predicates on tspatial
(Before/After/Overbefore/Overafter for tspatial × stbox /
stbox × tspatial / tspatial × tspatial), reusing the existing
`DEFINE_TSPATIAL_STBOX_POS` macro since MEOS exports follow the
same shape as the spatial-axis predicates.
3. Registers each time-axis predicate under both the bare named form
(before/after/overbefore/overafter) and the `temporal_*` alias.
The whole tspatial × {stbox, tspatial} position registration block
is collapsed into a single `REG_TSPATIAL_OP` macro that emits the
6 (sql_name + alias) × type-pair combinations per direction.
Total added: 36 named-alias registrations + 12 new handlers + 12 new
operator/named time-axis registrations.
Test: test/sql/parity/062_tspatial_posops.test (10 assertions covering
X/Y/Z axes, time axis, and operator-vs-alias equivalence).
Full suite: 762 / 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/062_tpoint_posops` by name.
Two parallel bumps
A. `temporal_*` aliases for the existing 36 spatial-axis registrations
The 12 spatial-axis predicates (`left` / `right` / `below` / `above` / `front` / `back` + `over*` variants) were already wired with operator/named forms. This PR adds the MobilityDB-canonical `temporal_*` named aliases (`temporal_left` / `temporal_below` / etc.) against the same handlers.
B. New time-axis predicates on tspatial
Adds 12 new handlers for time-axis predicates on tspatial, reusing the existing `DEFINE_TSPATIAL_STBOX_POS` macro:
Each routes to the matching MEOS export (`before_tspatial_stbox`, etc.). Registered under both the bare named form (`before` / `after` / `overbefore` / `overafter`) and the `temporal_*` alias for each of the 3 type-pair directions.
Implementation
The whole `tspatial × {stbox, tspatial}` registration block is collapsed into a single `REG_TSPATIAL_OP(SQL_NAME, ALIAS, FN)` macro that emits 6 registrations per direction (operator + alias × 3 type pairs). Replaces ~36 hand-written lines with 16 macro invocations.
Operator-form notes
DuckDB accepts `<<` / `>>` / `&<` / `&>` as operator tokens, so left/right/overleft/overright are registered both as operators and as named functions. The MobilityDB `<<|` / `|>>` / `/<<` / `>>/` (Y/Z axes) and `<<#` / `#>>` / `&<#` / `#&>` (time axis) tokens are unreachable through DuckDB's parser, so those predicates only have named forms — consistent with PR #74's handling.
Tests
Coverage delta
Per the audit in PR #66:
Test plan