feat(bindings): getBin + tbox tile emitters#85
Closed
estebanzimanyi wants to merge 1 commit into
Closed
Conversation
…ueTimeTiles)
Adds the single-bin getter family and the LIST<TBOX> emitters that are
the scalar counterparts of the prior bins() / tboxes() table functions.
getBin(integer, integer, integer) -> intspan
getBin(bigint, bigint, bigint) -> bigintspan
getBin(double, double, double) -> floatspan
getBin(date, interval, date) -> datespan
getBin(timestamptz, interval, timestamptz) -> tstzspan
valueTiles(tbox, vsize [, vorigin]) -> LIST<tbox>
timeTiles(tbox, duration [, torigin]) -> LIST<tbox>
valueTimeTiles(tbox, vsize, duration
[, vorigin, torigin]) -> LIST<tbox>
The tbox emitters dispatch on tbox->span.spantype so the same SQL
function transparently handles TBOXINT and TBOXFLOAT inputs without
the user having to pick a numeric variant. Defaults match MobilityDB's
SQL: vorigin = 0, torigin = '2000-01-03'.
Test 025_temporal_tile_getters.test exercises all five getBin variants
and the three emitters across both int and float tboxes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 1, 2026
Member
Author
|
Superseded by the consolidated PR branch |
4 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.
Summary
Adds the scalar tile family that's a counterpart to the
bins()/tboxes()table-function work.getBin(value, size, origin)— five overloads (int / bigint / float / date / timestamptz) returning the typed span containingvalue.valueTiles(tbox, vsize [, vorigin])—LIST<TBOX>of value-axis tiles.timeTiles(tbox, duration [, torigin])—LIST<TBOX>of time-axis tiles.valueTimeTiles(tbox, vsize, duration [, vorigin, torigin])—LIST<TBOX>of cartesian tiles.The three
tboxemitters dispatch ontbox->span.spantypeso a single SQL function transparently coversTBOXINTandTBOXFLOAT. Defaults match MobilityDB SQL (vorigin = 0,torigin = '2000-01-03').Note on a MobilityDB doc bug found while writing this
While verifying expected outputs I noticed the MobilityDB manual's
getBinsection has two issues — return-type missing forgetBin(date, ...), return type wrongly stated astimestamptz(should betstzspan) forgetBin(timestamptz, ...), and theinterval '1 week'example output looks wrong ([2001-01-03, 2001-01-10)doesn't match whatint_get_binactually computes, which is[2001-01-01, 2001-01-08)). I have local fixes ready for the doc — will send those upstream separately, not in this PR.Test plan
test/sql/parity/025_temporal_tile_getters.test— 15 assertions covering all fivegetBinvariants, both int and floattboxdispatch in each emitter, and the explicit-toriginoverride path.001_set.test.🤖 Generated with Claude Code