Skip to content

Propagate wrapper-bound literals to per-base-type siblings#61

Merged
estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:feat/boundargs-basetype-siblings
Jul 16, 2026
Merged

Propagate wrapper-bound literals to per-base-type siblings#61
estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:feat/boundargs-basetype-siblings

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

Follow-on to #60. The boundArgs pass records a literal that a MobilityDB PG wrapper binds for a SQL-hidden input (e.g. Temporal_value_at_timestamptz binds strict to true). Since #60 keys each function to its own wrapper body, and a base-type-generic wrapper calls only the GENERIC MEOS function by name (temporal_value_at_timestamptz), the per-base-type siblings the catalog collapses onto that same wrapper (tbool_/tint_/tfloat_/ttext_value_at_timestamptz) go unmatched and carry no boundArgs.

A binding generator that dispatches to a typed sibling for a typed result then has no bound literal and emits the wrong default — MobilitySpark generates valueAtTimestamp as strict=false, returning the value at an exclusive bound where MobilityDB semantics return NULL.

This groups functions by the wrapper they share (mdbC), reads the bound literals once from the wrapper body, and propagates them by parameter name to every group member that owns that parameter. Single-wrapper functions stay unchanged. The generic and all its per-type siblings carry boundArgs={strict:true}.

tests/test_boundargs.py adds a per-base-type sibling that shares the wrapper but is never called by name and asserts it inherits {strict:true}.

A per-base-type accessor (tbool/tint/tfloat/ttext_value_at_timestamptz) shares
its PG wrapper (Temporal_value_at_timestamptz) with the generic function but is
never called by name — the wrapper calls the generic, which dispatches
internally. So only the generic received shape.boundArgs, while a binding that
dispatches to the typed sibling for a typed result (every binding does) saw no
bound literal and fell back to a wrong default (strict=false).

Group functions by the wrapper they share and apply the wrapper's bound literals
to every group member by parameter name, so each typed sibling carries
boundArgs={strict:true} too.
@estebanzimanyi
estebanzimanyi merged commit cafc219 into MobilityDB:master Jul 16, 2026
2 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