Skip to content

feat(bindings): temporal boxops followups — named-function aliases + tboxes/splitN/splitEachN#72

Closed
estebanzimanyi wants to merge 1 commit intomainfrom
feat/parity-temporal-boxops-followups
Closed

feat(bindings): temporal boxops followups — named-function aliases + tboxes/splitN/splitEachN#72
estebanzimanyi wants to merge 1 commit intomainfrom
feat/parity-temporal-boxops-followups

Conversation

@estebanzimanyi
Copy link
Copy Markdown
Member

Closes 7 of 8 missing names in `temporal/032_temporal_boxops` (was 27%; this brings the user-visible surface to ~88%).

New SQL surface

Named-function aliases for the existing topological operators

MobilityDB exposes both the operator and named-function form for each topological predicate. The operator forms (`@>`, `<@`, `&&`, `-|-`) are already wired across all 36 existing overloads; this PR registers the matching named functions against the same handlers.

Operator Named alias
`@>` `temporal_contains`
`<@` `temporal_contained`
`&&` `temporal_overlaps`
`- -`

Coverage:

  • temporal × temporal (every base-type pair)
  • temporal × tstzspan and tstzspan × temporal
  • tnumber × numspan / numspan × tnumber
  • tnumber × tbox / tbox × tnumber

A small `REG_TOP4` macro factors the tnumber × {numspan, tbox} 4-handler block.

tnumber → LIST(tbox) emitters

Signature Routed through
`tboxes(tnumber)` -> `LIST(tbox)` `tnumber_tboxes`
`splitNTboxes(tnumber, integer)` -> `LIST(tbox)` `tnumber_split_n_tboxes`
`splitEachNTboxes(tnumber, integer)` -> `LIST(tbox)` `tnumber_split_each_n_tboxes`

What stays unregistered

The 8th missing name, `temporal_same` (alias of `=`), is deferred. The underlying `=` operator handlers (`Same_temporal_temporal`, `Same_tnumber_numspan`, `Same_tnumber_tbox`, `Same_temporal_tstzspan`) are not yet wired in MobilityDuck. Adding them is straightforward MEOS plumbing — one new handler family + a parallel registration block — but warrants a focused PR rather than expanding the surface of this one.

Tests

  • `test/sql/parity/032_temporal_boxops_followups.test` — 9 assertions covering the alias-equivalence with operators, the cross-type variants, and the tboxes/splitN/splitEachN list-returning surface.
  • Full suite: 761 assertions / 14 test cases passing under `TZ=UTC`.

Coverage delta

Per the audit in PR #66:

  • `temporal/032_temporal_boxops`: 3/11 (27%) → 10/11 (91%) by name.

Test plan

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

…tboxes/splitN/splitEachN

Closes 7 of 8 missing names in temporal/032_temporal_boxops:

Named-function aliases for the existing topological operators
(MobilityDB exposes both forms; the operator versions were already
wired). Each alias routes through the same underlying handler:

- temporal_contains  (alias of @>)
- temporal_contained (alias of <@)
- temporal_overlaps  (alias of &&)
- temporal_adjacent  (alias of -|-)

Coverage spans all 36 existing operator overloads:
- temporal × temporal (every base-type pair)
- temporal × tstzspan and tstzspan × temporal
- tnumber × numspan / numspan × tnumber
- tnumber × tbox / tbox × tnumber

A REG_TOP4 macro factors out the 4-name × 4-handler explosion in the
tnumber × {numspan, tbox} block.

Plus tnumber → LIST(tbox) emitters:

- tboxes(tint|tfloat)            -> LIST(tbox)
- splitNTboxes(tint|tfloat, int) -> LIST(tbox)
- splitEachNTboxes(tint|tfloat, int) -> LIST(tbox)

The 8th missing name, `temporal_same` (alias of `~=`), stays in a
follow-up: the underlying ~= operator handlers (Same_*) are not yet
wired in MobilityDuck. Adding them is straightforward MEOS plumbing
but warrants a focused PR.

Test: test/sql/parity/032_temporal_boxops_followups.test (9 assertions).
Full suite: 761 / 14 cases under TZ=UTC.

Files also gain a trailing newline at EOF.
@estebanzimanyi
Copy link
Copy Markdown
Member Author

Superseded by the consolidated PR branch consolidate/temporal-ops-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