Resolve the array-return element type in the catalog shape#41
Merged
estebanzimanyi merged 1 commit intoJul 10, 2026
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The array-output shape (
shape.arrayReturn) carried onlylengthFrom, 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 mirroringreturnType/params:double *→double(a by-value scalar element)TimestampTz *→TimestampTzstruct TInstant **→struct TInstant *(an array of element pointers)A binding then composes its native collection over
element.canonicalthrough its existing per-type marshaller, with zero return-string parsing. The transform is mechanical and canonical (the inverse of "an array ofEis spelledE *"), 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-resolvedelement.tests/test_shapeinfer.pygains a by-value-scalar case and an array-of-pointers assertion (5/5 pass).