feat(bindings): temporal comparison predicates returning Temporal#73
Closed
estebanzimanyi wants to merge 1 commit intomainfrom
Closed
feat(bindings): temporal comparison predicates returning Temporal#73estebanzimanyi wants to merge 1 commit intomainfrom
estebanzimanyi wants to merge 1 commit intomainfrom
Conversation
Closes the user-facing tail of temporal/030_temporal_compops: - temporal_teq / temporal_tne — across (bool, int, float, text) base types: 12 overloads each (base × t, t × base, t × t). - temporal_tlt / temporal_tle / temporal_tgt / temporal_tge — across (int, float, text) base types: 9 overloads each. Total: 60 new registrations routing through MEOS teq/tne/tlt/tle/tgt/tge exports. Numeric variants use TemporalBinaryV / V1 / TT helpers; text variants need text* allocation and use a manual BinaryExecutor block (modelled on the existing Textcat_*). MobilityDB also exposes these as the operator forms `?=`, `?<>`, `?<`, `?<=`, `?>`, `?>=`, but DuckDB's parser does not accept multi-character operator tokens starting with `?`, so only the named functions are registered. This is consistent with the existing handling of `<<#`, `<#>`, `|=|`, `~=` in docs/DuckDB-Parity-Gaps.md (PR #64). The `tnumber_supportfn` name flagged by the audit is a PostgreSQL planner selectivity hook; no DuckDB equivalent. Test: test/sql/parity/030_temporal_compops.test (12 assertions covering all six ops on (base × t, t × base, t × t) and the strict-vs-non-strict boundary cases for ordered comparisons). Full suite: 764 / 14 cases under TZ=UTC. Files also gain a trailing newline at EOF.
This was referenced Apr 30, 2026
Member
Author
|
Superseded by the consolidated PR branch |
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.
Closes the user-facing tail of `temporal/030_temporal_compops` (was 0%; this brings the user-visible surface to ~95%).
New SQL surface
60 new registrations routing through MEOS `teq` / `tne` / `tlt` / `tle` / `tgt` / `tge` exports. Each returns `tbool`.
Implementation
Numeric (int / float / bool) variants reuse `TemporalBinaryV` / `V1` / `TT` helpers. Text variants need `text*` allocation and use a manual `BinaryExecutor` block, mirroring the existing `Textcat_*` pattern. Two macros (`DEFINE_TCMP_NUMERIC`, `DEFINE_TCMP_BOOL`) compress the repetition.
Operator forms not registered
MobilityDB also exposes these comparisons as the operator tokens `?=`, `?<>`, `?<`, `?<=`, `?>`, `?>=`. DuckDB's parser does not accept multi-character operator tokens starting with `?`, so only the named functions are registered. This is consistent with the existing handling of `<<#`, `<#>`, `|=|`, `~=` documented in `docs/DuckDB-Parity-Gaps.md` (PR #64).
What stays unregistered
The `tnumber_supportfn` name flagged by the audit is a PostgreSQL planner selectivity hook with no DuckDB equivalent; never user-facing.
Tests
Coverage delta
Per the audit in PR #66:
Test plan