Skip to content

Generate temporal_hash_extended over all temporal families - #237

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:feat/duck-hash-extended-ubigint
Jul 31, 2026
Merged

Generate temporal_hash_extended over all temporal families#237
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:feat/duck-hash-extended-ubigint

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

Generates the extended (64-bit, seeded) hash temporal_hash_extended(<ttype>, UBIGINT) for every temporal family, inherited through Temporal<T> — the DuckDB side of the MEOS temporal_hash_extended surface.

The uint64 hash and its seed use DuckDB's native UBIGINT, not a signed BIGINT: a MEOS hash fills the full unsigned range (temporal_hash_extended(tint '1@2000-01-01', 0) = 11445401048662056440 > 2^63 does not fit a signed BIGINT), and DuckDB range-checks the cast rather than bit-reinterpreting the way PostgreSQL/C do.

Generator — keys uint64_t to UBIGINT in the scalar arg/return maps (SCALAR, SCALAR_ARG, SCALAR_RET_CPP), and checks the Tcell cell-id branch before the generic scalar branch in ret_type/shape_emittable so a uint64 cell id keeps its cell type (h3index/quadbin) instead of collapsing to UBIGINT.

Adds test/sql/temporal_hash.test covering temporal_hash (UINTEGER) and temporal_hash_extended (UBIGINT + seed).

@estebanzimanyi
estebanzimanyi force-pushed the feat/duck-hash-extended-ubigint branch 3 times, most recently from d292795 to 874fc3a Compare July 31, 2026 09:42
Generates the extended (64-bit, seeded) hash temporal_hash_extended(<ttype>,
UBIGINT) for every temporal family, inherited through Temporal<T> — the Duck
side of the MEOS temporal_hash_extended surface.

The uint64 hash and its seed use DuckDB's native UBIGINT, not a signed BIGINT:
a MEOS hash fills the full unsigned range (temporal_hash_extended(tint
'1@2000-01-01', 0) = 11445401048662056440 > 2**63 does not fit a signed
BIGINT), and DuckDB range-checks the cast rather than bit-reinterpreting the
way PostgreSQL/C do.

Generator: key uint64_t to UBIGINT in the scalar arg/return maps (SCALAR,
SCALAR_ARG, SCALAR_RET_CPP), and check the Tcell cell-id branch before the
generic scalar branch in ret_type and shape_emittable so a uint64 cell id
keeps its cell type instead of collapsing to UBIGINT.
@estebanzimanyi
estebanzimanyi force-pushed the feat/duck-hash-extended-ubigint branch from 874fc3a to e1f5b91 Compare July 31, 2026 10:23
@estebanzimanyi
estebanzimanyi merged commit a95db85 into MobilityDB:main Jul 31, 2026
7 checks passed
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