Skip to content

feat(bindings): tspatial position predicates — temporal_* aliases + time-axis#77

Closed
estebanzimanyi wants to merge 1 commit into
mainfrom
feat/parity-tspatial-posops
Closed

feat(bindings): tspatial position predicates — temporal_* aliases + time-axis#77
estebanzimanyi wants to merge 1 commit into
mainfrom
feat/parity-tspatial-posops

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

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:

  • `Before_tspatial_stbox` / `Before_stbox_tspatial` / `Before_tspatial_tspatial`
  • `After_*` × 3
  • `Overbefore_*` × 3
  • `Overafter_*` × 3

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

  • `test/sql/parity/062_tspatial_posops.test` — 10 assertions covering X / Y / Z axes, time axis, and operator-vs-alias equivalence.
  • Full suite: 762 assertions / 14 test cases passing under `TZ=UTC`.

Coverage delta

Per the audit in PR #66:

  • `geo/062_tpoint_posops`: 0/16 → 16/16 (100%) by name.

Test plan

  • `cmake --build . --target shell unittest` clean
  • New parity test passes (10/10)
  • Full suite green (762/14)

…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.
@estebanzimanyi estebanzimanyi marked this pull request as ready for review May 1, 2026 19:13
@estebanzimanyi

Copy link
Copy Markdown
Member Author

Superseded by the consolidated PR branch consolidate/spatial-predicates-parity. All changes from this PR are included in that branch as a single squashed commit. Please review and merge the consolidated branch instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant