Skip to content

feat(bindings): tile and bin functions parity — emitters / table functions / getters#102

Open
estebanzimanyi wants to merge 1 commit intomainfrom
consolidate/tiles-bins-parity
Open

feat(bindings): tile and bin functions parity — emitters / table functions / getters#102
estebanzimanyi wants to merge 1 commit intomainfrom
consolidate/tiles-bins-parity

Conversation

@estebanzimanyi
Copy link
Copy Markdown
Member

@estebanzimanyi estebanzimanyi commented May 4, 2026

👀 Reviewers: tier ranking, dependency chains and the standards checklist live in doc/contributing/reviewer-guide.md.

Summary

Consolidates 6 individual parity PRs (previously #62, #79, #81, #82, #85, #88) into one squashed commit.

  • bins(span | spanset, vsize, vorigin) table function
  • Tile emitters: bins/valueBins/timeBins/valueBoxes/valueTimeBoxes
  • valueSplit / timeSplit / valueTimeSplit TableFunctions
  • geo/058 tpoint tile: tiles/boxes/getters + spaceSplit/spaceTimeSplit TableFunctions
  • getBin + tbox tile emitters (valueTiles/timeTiles/valueTimeTiles)
  • Single-tile getters: tbox + stbox variants

Test plan

  • test/sql/parity/025_temporal_tile_getters.test
  • test/sql/parity/026_single_tile_getters.test
  • test/sql/parity/058_tile_emitters.test
  • test/sql/parity/059_split_path.test

🤖 Generated with Claude Code

estebanzimanyi added a commit that referenced this pull request May 5, 2026
…istance

Parity tests activated (21/23 files now pass; 2 tile/split files remain
skipped pending table-function architecture, tracked by PRs #102/#110):

  015_span_aggfuncs   — SetUnionAgg / SpanUnionAgg / extent (20 assertions)
  022_temporal        — temporal accessors + operators (32 assertions)
  032_temporal_box    — tbox constructors + expandValue/expandTime (3 assertions)
  032_temporal_topops — temporal @> tbox / && temporal / -|- tstzspan (3 assertions)
  036_tnumber_distance — tint<->tint, nad, nearestApproachDistance (3 assertions)
  040_temporal_aggfuncs — TcountAgg/TandAgg/TminAgg/TsumAgg/extent (5 assertions)
  042_temporal_waggfuncs — WminAgg/WmaxAgg/WsumAgg (3 assertions)
  050_geo_inventory   — geo surface manifest activated (1 assertion)
  009_time_ops        — tstzset/tstzspan + interval shift; tstzspan <-> INTERVAL (4 assertions)

Bug fixes:
  - tstzspan/tstzset <-> operator: was registered as INTERVAL but implementation
    returned double, causing INTERNAL crash. Fixed Distance_span_value,
    Distance_value_span (use distance_span_timestamptz), Distance_span_span
    (dispatch on T_TSTZSPAN), Distance_set_value/Distance_value_set/
    Distance_set_set (tstzset case). All time-type distances now return
    interval_t normalised to days+micros so "2 days" formats correctly.
  - expandValue(tbox, INTEGER): TboxExpandValueExecutor<int64_t> caused
    INTERNAL error "Expected vector of type INT64, but found vector of type
    INT32". Fixed template parameter to int32_t.
  - SetUnionAgg(date): date_to_set called raw DuckDB date_t without epoch
    offset conversion, producing dates 30 years in future. Added
    date_to_set_duckdb wrapper using ToMeosDate().

New registrations:
  - "+", {tstzset, INTERVAL} → tstzset: shift alias (MobilityDB @> parity)
  - "+", {tstzspan, INTERVAL} → tstzspan: shift alias
  - SecondsToInterval helper in time_util.hpp

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
estebanzimanyi added a commit that referenced this pull request May 10, 2026
…istance

Parity tests activated (21/23 files now pass; 2 tile/split files remain
skipped pending table-function architecture, tracked by PRs #102/#110):

  015_span_aggfuncs   — SetUnionAgg / SpanUnionAgg / extent (20 assertions)
  022_temporal        — temporal accessors + operators (32 assertions)
  032_temporal_box    — tbox constructors + expandValue/expandTime (3 assertions)
  032_temporal_topops — temporal @> tbox / && temporal / -|- tstzspan (3 assertions)
  036_tnumber_distance — tint<->tint, nad, nearestApproachDistance (3 assertions)
  040_temporal_aggfuncs — TcountAgg/TandAgg/TminAgg/TsumAgg/extent (5 assertions)
  042_temporal_waggfuncs — WminAgg/WmaxAgg/WsumAgg (3 assertions)
  050_geo_inventory   — geo surface manifest activated (1 assertion)
  009_time_ops        — tstzset/tstzspan + interval shift; tstzspan <-> INTERVAL (4 assertions)

Bug fixes:
  - tstzspan/tstzset <-> operator: was registered as INTERVAL but implementation
    returned double, causing INTERNAL crash. Fixed Distance_span_value,
    Distance_value_span (use distance_span_timestamptz), Distance_span_span
    (dispatch on T_TSTZSPAN), Distance_set_value/Distance_value_set/
    Distance_set_set (tstzset case). All time-type distances now return
    interval_t normalised to days+micros so "2 days" formats correctly.
  - expandValue(tbox, INTEGER): TboxExpandValueExecutor<int64_t> caused
    INTERNAL error "Expected vector of type INT64, but found vector of type
    INT32". Fixed template parameter to int32_t.
  - SetUnionAgg(date): date_to_set called raw DuckDB date_t without epoch
    offset conversion, producing dates 30 years in future. Added
    date_to_set_duckdb wrapper using ToMeosDate().

New registrations:
  - "+", {tstzset, INTERVAL} → tstzset: shift alias (MobilityDB @> parity)
  - "+", {tstzspan, INTERVAL} → tstzspan: shift alias
  - SecondsToInterval helper in time_util.hpp

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@estebanzimanyi
Copy link
Copy Markdown
Member Author

Cross-reference: docs/CONSOLIDATION-PLAN.md on #115

This PR's surface overlaps with parity commits already on main (e41c8d9 → c8cad6d). The overlap matrix and three resolution options per overlap (rebase / revert+fold / keep both) are documented in docs/CONSOLIDATION-PLAN.md on #115. Maintainer's call which path to take per PR.

estebanzimanyi added a commit that referenced this pull request May 10, 2026
Two new docs:
- docs/PR-COORDINATION.md — ecosystem policy: gh pr list is the first
  step before any code change; don't duplicate or conflict with
  in-flight PRs/policies. Cross-ecosystem variant. One PR = one commit
  = one feature consolidation rule with the git commit-tree squash
  recipe.
- docs/CONSOLIDATION-PLAN.md — working artefact mapping the file-level
  overlap between commits already on main and the open consolidate/*
  parity PRs (#97/#98/#99/#100/#102/#103/#104) plus PR #111
  (per-thread MEOS init). Three resolution options per overlap
  (rebase / revert+fold / keep both); maintainer picks per PR.

Pre-emptive policy preventing the duplication and policy-conflict
failures that produced the consolidate/* / main overlap and the
single-timezone / per-thread-MEOS-init clash.
…tions / getters

Brings the tile and bin function surface to parity with MobilityDB:

- Bin emitters: timeBin, valueBin, spaceBin, valueTimeBin, spaceTimeBin
  scalar forms returning the bin span/box for a given input.
- Tile emitters: timeTiles, valueTiles, spaceTiles, valueTimeTiles,
  spaceTimeTiles table-function forms returning the LIST of bins
  covering the input domain.
- Tile getters: getBin, getValueBin, getTimeBin, getSpaceBin family
  scalar forms looking up the bin index for a value.
- Tpoint-specific tile emitters covering the spatial dimensions.

Includes the RegisterTemporalTileSplit implementation
(timeSplit/valueSplit/valueTimeSplit) — table functions emitting the
SETOF (bin, sliced_temporal) tuples that DuckDB requires.
@estebanzimanyi estebanzimanyi force-pushed the consolidate/tiles-bins-parity branch from a37e63d to c42bdc8 Compare May 10, 2026 13:28
estebanzimanyi added a commit that referenced this pull request May 10, 2026
…nsolidates #115 + #119)

Three related artefacts that prevent the same class of failure (parallel
work on the same surface drifting in policy and offset state):

docs/PR-COORDINATION.md — ecosystem policy: gh pr list is the first
step before any code change; minimise PR count by folding into existing
PRs; squash each PR to a single commit before review.  Cross-ecosystem
variant for MobilityDB / JMEOS / PyMEOS / MobilitySpark / MEOS-API.

docs/CONSOLIDATION-PLAN.md — file-level overlap matrix between commits
already on main and the open consolidate/* parity PRs (#97/#98/#99/
#100/#102/#103/#104) plus PR #111 (per-thread MEOS init); three
resolution options per overlap.  Working artefact, delete once
consolidations land.

scripts/lint-tz-pinned-tests.py — flags every line in an
expected-output block that carries a hardcoded UTC offset.  Pre-commit
gate / CI lint.  Today reports 734 hits across 43 files; the lint
makes the timezone-neutral migration trackable.

scripts/parity-audit.py — adds an OUT_OF_SCOPE_NAMES bucket for
function names that are out-of-scope by domain (not by suffix
pattern):
- transform_gk: Gauss-Krüger projection added to MobilityDB for the
  SECONDO platform integration; no equivalent need in MobilityDuck.
- create_trip: BerlinMOD synthetic-trip generator; runs in
  MobilityDB / SECONDO and emits parquet artefacts that MobilityDuck
  consumes — MobilityDuck does not need to host the generator itself.

Pairs naturally with PR #111 / commit 9dd765a's timezone-neutral test
policy: the doc tells contributors what to do, the lint enforces it,
the parity audit reflects realistic coverage now that two domain-
specific names are off the missing list.
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