feat(bindings): tprecision / tsample — temporal time-domain rebinning#78
Closed
estebanzimanyi wants to merge 1 commit into
Closed
feat(bindings): tprecision / tsample — temporal time-domain rebinning#78estebanzimanyi wants to merge 1 commit into
estebanzimanyi wants to merge 1 commit into
Conversation
Closes the user-facing tprecision/tsample gap in temporal/022_temporal.
New SQL surface:
- tprecision(tint|tfloat, interval[, origin timestamptz])
-> Temporal_tprecision -> tnumber
4 overloads (2 base types × 2 origin variants).
- tsample(tbool|tint|tfloat|ttext, interval[, origin timestamptz[, interp text]])
-> Temporal_tsample -> Temporal of same type
12 overloads (4 base types × 3 origin/interp variants).
The interpolation string is parsed in C++ via ParseInterpString
("none" | "discrete" | "step" | "linear"), throwing on unknown values.
DEFAULT_T_ORIGIN matches MEOS's `2000-01-03` reference origin (encoded
as 0 microseconds in MEOS's epoch).
Test: test/sql/parity/022_temporal_tprecision_tsample.test (7 assertions
including default-origin and explicit-origin variants, linear/step/discrete
interpolation, and an error case for an invalid interp string).
Full suite: 759 / 14 cases under TZ=UTC.
Files also gain a trailing newline at EOF.
This was referenced May 1, 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 tprecision/tsample gap in `temporal/022_temporal`.
New SQL surface
16 new registrations total: 4 `tprecision` overloads + 12 `tsample` overloads.
Implementation
Both handlers walk the rows manually (rather than using `BinaryExecutor`) since they have variable arity (2-4 args). The interpolation string is parsed in C++ via `ParseInterpString`:
Unknown values throw `InvalidInputException`.
`DEFAULT_T_ORIGIN` is `0` (MEOS encodes its `2000-01-03` reference origin as 0 microseconds), matching MobilityDB's SQL `DEFAULT '2000-01-03'`.
Tests
Coverage delta
Per the audit in PR #66:
Test plan