Skip to content

Resolve the array-return element type in the catalog shape#41

Merged
estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:feat/arrayreturn-element-type
Jul 10, 2026
Merged

Resolve the array-return element type in the catalog shape#41
estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:feat/arrayreturn-element-type

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

The array-output shape (shape.arrayReturn) carried only lengthFrom, so every binding had to re-parse the return string to derive the element type for its native list/array. That return-string parsing is exactly the per-binding heuristic the codegen North Star forbids.

This attaches shape.arrayReturn.element = {c, canonical} — the return with exactly one pointer level stripped, resolved as a first-class type object mirroring returnType/params:

  • double *double (a by-value scalar element)
  • TimestampTz *TimestampTz
  • struct TInstant **struct TInstant * (an array of element pointers)

A binding then composes its native collection over element.canonical through its existing per-type marshaller, with zero return-string parsing. The transform is mechanical and canonical (the inverse of "an array of E is spelled E *"), not a heuristic; it is additive and touches only the array-output families.

Verified by regenerating the catalog from MobilityDB master 850f2ac1: 165/165 array-returns carry a correctly-resolved element. tests/test_shapeinfer.py gains a by-value-scalar case and an array-of-pointers assertion (5/5 pass).

The array-output shape carried only lengthFrom, so every binding had to
re-parse the return string to derive its native list/array element type.

Attach shape.arrayReturn.element = {c, canonical} — the return with exactly
one pointer level stripped (double * -> double, a by-value element; TInstant
** -> TInstant *, an array of pointers). A binding thus composes its native
collection over element.canonical through its existing per-type marshaller
with zero return-string parsing. Mechanical and canonical, not a heuristic.

Regenerated from master 850f2ac1: 165/165 array-returns carry element.
@estebanzimanyi estebanzimanyi merged commit 8706ffc into MobilityDB:master Jul 10, 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