Skip to content

Attach the @sqlfn SQL-name map to the catalog#18

Open
estebanzimanyi wants to merge 2 commits into
MobilityDB:masterfrom
estebanzimanyi:feat/sqlfn-name-map
Open

Attach the @sqlfn SQL-name map to the catalog#18
estebanzimanyi wants to merge 2 commits into
MobilityDB:masterfrom
estebanzimanyi:feat/sqlfn-name-map

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

The catalog carries MEOS-C names + C signatures but not the user-facing SQL names that SQL/UDF-emitting bindings (MobilitySpark, MobilityDuck, MobilityDB SQL) need. Both are machine-extractable from the doxygen tag chain already in the source:

MEOS-C fn --@csqlfn #Wrapper()--> MobilityDB-C wrapper --@sqlfn name() / @sqlop @p <op>--> SQL name + operator

parser/sqlfn.py extracts and joins the chain from the vendored _mobilitydb/ source; run.py attaches sqlfn/sqlop/mdbC per function as step 4. 1997 / 2830 functions now carry their SQL name (e.g. tpoint_length->length, econtains_geo_tgeo->eContains, temporal_value_at_timestamptz->valueAtTimestamp); the rest are internal (no SQL surface).

Binding generators can now read SQL names from the single SoT instead of per-binding hand-maps.

Byproduct — wrappers missing @sqlfn (chain reachable but tag absent), for a follow-up source pass: Stbox_constructor (->stbox), Temporal_after_timestamptz (->afterTimestamp), Temporal_before_timestamptz (->beforeTimestamp), Temporal_simplify_max_dist (->maxDistSimplify).

Follow each function's @csqlfn -> wrapper @sqlfn -> SQL name chain and
attach the resulting SQL name to the catalog. The vendored-source root is
overridable via MDB_SRC_ROOT so the @sqlfn (and @InGroup) extraction can be
pointed at the same pinned MobilityDB checkout as the headers, keeping the
generated catalog reproducibly equivalent to that pin.
A copy-paste @csqlfn in meos/src can point an ever/always spatial-relationship function
(named <e|a><verb>_...) at the opposite-prefix MobilityDB-C wrapper — e.g.
eintersects_tgeo_geo is tagged `@csqlfn #Aintersects_tgeo_geo`, so the chain resolves its
@sqlfn to aIntersects instead of eIntersects. That silently drops the real (tgeo,geo)
overload from the eIntersects group in a binding's overload dispatcher, leaving only a
wrong-subtype backing reachable — which then raises a runtime "The temporal value must be
of type tcbuffer" on a tgeompoint (observed in the MobilitySpark BerlinMOD bench, q17).

The parser is faithful — it propagates whatever the source tags say — so this is a source
defect to fix in meos/src, not a parser bug. Add lint_ea_sqlfn() and report the mismatches
at catalog-gen so they surface loudly instead of shipping a wrong @sqlfn silently. Flags 5
live mistags (eintersects_tgeo_geo, etouches_tpoint_geo/_tcbuffer_geo/_tcbuffer_cbuffer,
econtains_geo_trgeo); relayed to the source maintainers to correct the @csqlfn tags.
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