Skip to content

docs: remove stale RANGE-support TODOs (RANGE is PG-only by design)#163

Open
estebanzimanyi wants to merge 6 commits into
MobilityDB:mainfrom
estebanzimanyi:fix/drop-range-todos
Open

docs: remove stale RANGE-support TODOs (RANGE is PG-only by design)#163
estebanzimanyi wants to merge 6 commits into
MobilityDB:mainfrom
estebanzimanyi:fix/drop-range-todos

Conversation

@estebanzimanyi
Copy link
Copy Markdown
Member

Removes 5 stale // TODO (Type Range): … / // TODO: Multirange functions comments from src/include/temporal/span_functions.hpp and src/include/temporal/spanset_functions.hpp, replacing them with explanatory comments that document why RANGE will never be implemented in MobilityDuck.

The architectural rule

PostgreSQL's RANGE / MULTIRANGE are PG-specific types with no DuckDB analogue. MEOS's algebra is closed over MEOS types only — every argument and every result is a MEOS type. The semantically-equivalent canonical MEOS types are:

PG type MEOS type Notes
RANGE SPAN Same semantics (interval over an ordered base type); SPAN is fixed-length and bundles less functionality
MULTIRANGE SPANSET Same semantics (set of intervals); SPANSET is the canonical multi-interval container

Both SPAN and SPANSET are already first-class in MobilityDuck.

Why no convertor here

The range_to_span / span_to_range / multirange_to_spanset convertors are the PG↔MEOS impedance layer and live only in the MobilityDB PG extension itself (mobilitydb/src/temporal/spanset.c::Multirange_to_spanset). They have no place in MobilityDuck — there's no DuckDB RANGE type to convert to/from.

Ecosystem audit (for context)

Verified before this PR:

Layer range/multirange functions exported
MEOS libmeos.so 0
MobilityDB PG extension (mobilitydb/) Multirange_to_spanset (correct placement)
PyMEOS / PyMEOS-CFFI 0 (only enum names vendored)
MobilityDuck (this PR) 0 (TODOs were stale, never implemented)
MobilitySpark 0 (explicitly documented "range/multirange NOT registered — they wrap PG-specific types")
GoMEOS / MEOS.NET / JMEOS 0

This PR brings the comments into alignment with the actual ecosystem state.

Risk

Zero — comment-only change in header files; no behavioural change.

`meosType` (lower-case) is the **pre-consolidation** MEOS type name;
`MeosType` (upper-case) is the **post-consolidation** target that the
upstream rename sweep has not yet reached.  The current vcpkg pin
(`vcpkg_ports/meos/portfile.cmake` REF f11b7443ee98…) is still
pre-consolidation: `meos/include/temporal/meos_catalog.h` line 121
declares the typedef as `} meosType;` and every MEOS API uses the
lower-case spelling.  MobilityDuck's source code consistently uses
`meosType` to match — `grep -rn '\bMeosType\b' src/` finds the name
only on the alias line and its comment, nowhere else.

c8cad6d added `using meosType = MeosType;` as a forward-looking
bridge for the eventual consolidation bump.  That bridge points at
`MeosType`, which the current pin does NOT yet expose, so it
breaks every PR's Linux arm64 build with:

  /duckdb_build_dir/src/include/tydef.hpp:18:18:
    error: ‘MeosType’ does not name a type; did you mean ‘meosType’?

The fix is to drop the premature alias and replace the misleading
comment with one that documents the pre/post-consolidation distinction
and the resume path for the next pin bump — at that point a reviewer
can either restore the bridge (this time it'll be valid because
`MeosType` will exist) or sweep the MobilityDuck source from
`meosType` to `MeosType` in a single PR.

Unblocks every in-flight PR's Linux arm64 build: MobilityDB#126, MobilityDB#130, MobilityDB#149,
MobilityDB#158, MobilityDB#159, MobilityDB#160, plus the entire `feat/*_port_core` extended-type
stack (MobilityDB#148/MobilityDB#150/MobilityDB#151/MobilityDB#153/MobilityDB#155/MobilityDB#156).
The 5 `// TODO (Type Range): …` / `// TODO: Multirange functions`
comments in `span_functions.hpp` and `spanset_functions.hpp`
suggested implementing RANGE/MULTIRANGE support in MobilityDuck at
some future point.  Per the ecosystem's closed-algebra rule, this is
never going to happen: PostgreSQL's `RANGE` / `MULTIRANGE` are
PG-specific types with no DuckDB analogue, and MEOS's algebra is
closed over MEOS types only.  The semantically-equivalent canonical
MEOS types are `SPAN` (for `RANGE`) and `SPANSET` (for `MULTIRANGE`)
— both already first-class in MobilityDuck.

The `range_to_span` / `span_to_range` / `multirange_to_spanset`
convertors are the PG↔MEOS impedance layer and therefore live ONLY
in the MobilityDB PG extension itself
(`mobilitydb/src/temporal/spanset.c::Multirange_to_spanset`).  No
other binding (MobilityDuck, MobilitySpark, PyMEOS, GoMEOS,
MEOS.NET, JMEOS) implements them, and the audit confirms none of
them export range/multirange functions today either.

Replacing the stale TODOs with explanatory comments so a future
contributor doesn't reopen the question or accidentally re-add
them.

No behavioural change.
…MobilityDB#136)

Cherry-picked from open PR MobilityDB#136 (commit 9e1d7a6) so this PR's CI goes
green before MobilityDB#136 lands. When MobilityDB#136 reaches main, the rebase will
collapse this commit to a no-op and it will drop out.

--- original commit body ---
Pre-stage icu extension for amd64 docker tests

LoadInternal calls ExtensionHelper::AutoLoadExtension(db, "icu") so the
Europe/Brussels timezone option is honoured. Inside the linux_amd64 test
docker container there is no network egress and the local extension
directory is empty, so the autoload fails. Copy the icu.duckdb_extension
that was just built locally (declared in extension_config.cmake) into the
expected path before running the unittester.
…en PR MobilityDB#140)

On macOS LP64 and Wasm/emscripten, int64 (long) and int64_t (long long) are
the same width but distinct types, so clang rejects passing bigint_to_set
where a Set *(*)(int64_t) is expected as a non-type template arg. Cherry-
picked from open PR MobilityDB#140 (a8b1755) so this PR goes green on osx_amd64,
osx_arm64, and wasm_mvp before MobilityDB#140 lands. The cast is a no-op on Linux,
where int64 and int64_t are both long. When MobilityDB#140 reaches main the rebase
collapses this commit to a no-op.
The stage_icu helper mapped only the Linux uname values, so on the
macOS arm64 test runner uname -m returned "arm64" and the icu
extension was copied to .duckdb/extensions/v1.4.4/arm64 instead of
.../osx_arm64, where DuckDB's autoload looks. The hub fallback is not
reliably resolvable on that runner, so the osx_arm64 Test step failed
to load the extension. Map the OS and architecture to the DuckDB
platform string (linux_amd64, linux_arm64, osx_amd64, osx_arm64) so
the locally built icu is staged at the path autoload expects on every
tested platform; the Linux mapping is unchanged.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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