Skip to content

Generate the static quadbin cell-index scalar ops - #224

Open
estebanzimanyi wants to merge 2 commits into
mainfrom
feat/duck-quadbin-cell-ops
Open

Generate the static quadbin cell-index scalar ops#224
estebanzimanyi wants to merge 2 commits into
mainfrom
feat/duck-quadbin-cell-ops

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

Adds the static quadbin cell-index scalar ops of
quadbin/352_quadbin_ops.in.sql to the generator, following the
generate-then-retire procedure.

Generated (shape_quadbin_scalar, @InGroup meos_quadbin)

Eight scalar ops over the BIGINT-backed quadbin() type:
isValidCell / isValidIndex → boolean, quadbinGetResolution
integer, quadbinCellToParent / quadbinCellSibling /
quadbinTileToCell → quadbin, quadbinCellArea → double,
quadbinCellToQuadkey → text. The shape mirrors the h3 prefilter
sibling and emits only for a group in RETIRED_GROUPS.

Retired hand registrations

meos_quadbin is a member of RETIRED_GROUPS. The hand
quadbinGetResolution / quadbinTileToCell / quadbinIsValidCell
registrations are removed; isValidCell is the canonical MobilityDB
SQL name. The per-axis quadbinCellToTileX/Y/Z remain hand.

Held in RETIRE_UNCOVERED_OK

geoToQuadbinCell, quadbinCellToChildren, quadbinCellToPoint,
quadbinCellToBoundingBox, quadbinCellToTile require typed public
MEOS geometry-in / Set-out / geometry-out / array exports. The type
output quadbin_out is served by the quadbinVARCHAR cast.

Tests

tquadbin.test exercises the generated ops (20 assertions). The full
suite is green: 1602 assertions across 67 cases, on a clean build
against fresh master MEOS with zero first-party warnings.

@estebanzimanyi
estebanzimanyi force-pushed the feat/duck-quadbin-cell-ops branch 2 times, most recently from a5cc5a6 to 8d69575 Compare July 22, 2026 19:09
nhungoc1508 and others added 2 commits July 22, 2026 21:40
…ical

Regenerates the generated UDF surface from MobilityDB master (which brings in
the generic temporal_hash surface). The MEOS-API catalog now renders the uint32
canonical type as `unsigned int` (it was `uint32_t`); key the scalar type maps
on it so the *_hash functions keep registering instead of being dropped.

uint32 hashes map to DuckDB's native `UINTEGER`, not a signed `INTEGER` — a hash
>= 2**31 is out of range for INT32 and DuckDB range-checks the cast rather than
bit-reinterpreting the way PostgreSQL/C do; DuckDB has real unsigned SQL types,
so `UINTEGER` is the faithful representation.
Add shape_quadbin_scalar to the MobilityDuck generator: the @InGroup
meos_quadbin cell-index scalar ops over the BIGINT-backed quadbin()
type — isValidCell/isValidIndex (bool), quadbinGetResolution (integer),
quadbinCellToParent/quadbinCellSibling/quadbinTileToCell (quadbin),
quadbinCellArea (double) and quadbinCellToQuadkey (text). The shape is
gated on retired(f): meos_quadbin joins RETIRED_GROUPS and the hand
quadbinGetResolution / quadbinTileToCell / quadbinIsValidCell
registrations are retired (isValidCell is the canonical MobilityDB SQL
name; the per-axis quadbinCellToTileX/Y/Z stay hand pending an array
export).

The geometry-in / Set-out / geometry-out cell ops (geoToQuadbinCell,
quadbinCellToChildren, quadbinCellToPoint, quadbinCellToBoundingBox,
quadbinCellToTile) stay in RETIRE_UNCOVERED_OK pending typed public MEOS
exports; the type output function (quadbin_out) is served by the
quadbin<->VARCHAR cast.
@estebanzimanyi
estebanzimanyi force-pushed the feat/duck-quadbin-cell-ops branch from 8d69575 to 1ddd802 Compare July 22, 2026 19:41
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.

2 participants