Skip to content

feat(bindings): tile emitters — bins/valueBins/timeBins/valueBoxes/valueTimeBoxes#82

Closed
estebanzimanyi wants to merge 1 commit into
mainfrom
feat/parity-temporal-tile-emitters
Closed

feat(bindings): tile emitters — bins/valueBins/timeBins/valueBoxes/valueTimeBoxes#82
estebanzimanyi wants to merge 1 commit into
mainfrom
feat/parity-temporal-tile-emitters

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

Closes the LIST-emitting tail of `temporal/025_temporal_tile`. Companion to PR #81's TableFunction split surface.

New SQL surface (28 scalar registrations)

Signature Returns Routed through
`bins(intspan, integer[, integer])` `LIST(intspan)` `intspan_bins`
`bins(floatspan, double[, double])` `LIST(floatspan)` `floatspan_bins`
`bins(tstzspan, interval[, timestamptz])` `LIST(tstzspan)` `tstzspan_bins`
`valueBins(tint, integer[, integer])` `LIST(intspan)` `tint_value_bins`
`valueBins(tfloat, double[, double])` `LIST(floatspan)` `tfloat_value_bins`
`timeBins(, interval[, timestamptz])` `LIST(tstzspan)` `temporal_time_bins` (4 base types)
`valueBoxes(tnumber, vsize[, vorigin])` `LIST(tbox)` `tint/tfloat_value_boxes`
`valueTimeBoxes(tnumber, vsize, duration[, vorigin[, torigin]])` `LIST(tbox)` `tint/tfloat_value_time_boxes`

Implementation

A shared `EmitFlatList` helper writes a flat `LIST(span/tbox)` by allocating a child vector of fixed-size blobs and pointing the row's `list_entry_t` to its slice — same pattern as PR #79's tile emitters and PR #72's `tboxes`/`splitN`/`splitEachN`.

Hooked into `LoadInternal` via a new `RegisterTileEmitters` method on `TemporalTypes`, kept distinct from the scalar registrations and the `tempUnnest` / tile-split TableFunctions.

Tests

  • `test/sql/parity/025_tile_emitters.test` — 11 assertions covering each emitter on each base type, default-origin and explicit-origin variants, and the value-time cross-product.
  • Full suite: 763 assertions / 14 test cases passing under `TZ=UTC`.

Coverage delta

Per the audit in PR #66 and combined with PR #81 (TableFunction splits):

  • `temporal/025_temporal_tile` now closes `bins`, `valueBins`, `timeBins`, `valueBoxes`, `valueTimeBoxes`. Remaining: `getBin` / `getValueTile` / `getTBoxTimeTile` / `getValueTimeTile` / `valueTiles` / `timeTiles` / `valueTimeTiles` (single-tile getters and tbox-input emitters; small follow-up).

Test plan

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

…lueTimeBoxes

Closes the LIST-emitting tail of temporal/025_temporal_tile.

New scalar tile emitters (28 SQL registrations):

- bins(span, size[, origin]) -> LIST(span)
  6 overloads across {intspan, floatspan, tstzspan} × 2 origin variants.
- valueBins(tnumber, vsize[, vorigin]) -> LIST(span)
  4 overloads (tint × 2 + tfloat × 2).
- timeBins(temporal, duration[, torigin]) -> LIST(tstzspan)
  8 overloads (4 base types × 2 origin variants).
- valueBoxes(tnumber, vsize[, vorigin]) -> LIST(tbox)
  4 overloads.
- valueTimeBoxes(tnumber, vsize, duration[, vorigin[, torigin]]) -> LIST(tbox)
  6 overloads.

Each routes to the matching MEOS export (intspan_bins / floatspan_bins /
tstzspan_bins / tint_value_bins / tfloat_value_bins / temporal_time_bins /
tint_value_boxes / tfloat_value_boxes / tint_value_time_boxes /
tfloat_value_time_boxes). The shared EmitFlatList<T> helper writes a
flat LIST(span/tbox) by allocating a child vector of fixed-size blobs
and pointing the row's list_entry_t to its slice — same pattern as
PR #79's tile emitters and PR #72's tboxes/splitN/splitEachN.

Hooked into LoadInternal via a new RegisterTileEmitters method on
TemporalTypes.

Test: test/sql/parity/025_tile_emitters.test (11 assertions covering
each emitter on each base type, default-origin and explicit-origin
variants, and the value-time cross-product).
Full suite: 763 / 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/tiles-bins-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