Skip to content

Answer the several results of one call as one tuple - #37

Merged
estebanzimanyi merged 2 commits into
MobilityDB:mainfrom
estebanzimanyi:feat/several-answers-are-one-tuple
Sep 3, 2026
Merged

Answer the several results of one call as one tuple#37
estebanzimanyi merged 2 commits into
MobilityDB:mainfrom
estebanzimanyi:feat/several-answers-are-one-tuple

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

A split states its pieces through the return and the bin each piece falls in
through an array MEOS fills, and the flat wrapper already hands both over as a
tuple. The object layer had no reading for a tuple return, so the methods that
answer one deferred — the time and value splits of every temporal number, the
sequence-set span walks, the jsonb each. They now answer (Temporal?[], DateTime[]) and its siblings, each item read the way a return of its own type
is: an array of MEOS values wrapped element by element, an array of instants
read as instants, an array of scalars handed on. The element types come from
the shape the catalog states — arrayReturn.element for the return and the
out-array parameters for the rest — so nothing re-parses a C declaration.

The five bodies a method could have were mutually exclusive, and two deferrals
existed only to say so: a struct argument beside a counted array, and a length
out-parameter beside either. One composed body replaces them. Everything the
call needs is allocated or pinned first, the call is made ONCE, what it answers
is read, and everything allocated is freed however the method leaves — so
timeSplit, which takes an Interval by value and answers two arrays, needs
no reading its parts do not already have. A call that allocates nothing has
nothing to free, and gets the answer alone as its body.

The layer emits 1351 methods over 115 classes with 9 deferred, against 1342 and
18. Its own test states that the pieces and the bins of a split arrive together
and in step, from the one call that makes them.

The catalog gives the R-tree and SP-tree kNN cursors classes, so the object
layer carries `RTreeNNCursor` and `SPNNCursor`: a cursor is opened from a tree,
closed when the walk ends, and the three entries sit on the cursor rather than
among the tree's twenty methods. 115 classes and 1342 methods against 113 and
1338, 18 deferred against 22.

`TBigint.Values` reaches the layer with them, its count declared the way its
definition writes it, so every temporal number answers its distinct values as
an array of them.

`next` stays deferred on both cursors: it answers the id AND the distance
through two out-parameters, and one body writing both is the same shape the
value-and-time splits need.
A split states its pieces through the return and the bin each piece falls in
through an array MEOS fills, and the flat wrapper already hands both over as a
tuple. The object layer had no reading for a tuple return, so the methods that
answer one deferred — the time and value splits of every temporal number, the
sequence-set span walks, the jsonb each. They now answer `(Temporal?[],
DateTime[])` and its siblings, each item read the way a return of its own type
is: an array of MEOS values wrapped element by element, an array of instants
read as instants, an array of scalars handed on. The element types come from
the shape the catalog states — `arrayReturn.element` for the return and the
out-array parameters for the rest — so nothing re-parses a C declaration.

The five bodies a method could have were mutually exclusive, and two deferrals
existed only to say so: a struct argument beside a counted array, and a length
out-parameter beside either. One composed body replaces them. Everything the
call needs is allocated or pinned first, the call is made ONCE, what it answers
is read, and everything allocated is freed however the method leaves — so
`timeSplit`, which takes an `Interval` by value and answers two arrays, needs
no reading its parts do not already have. A call that allocates nothing has
nothing to free, and gets the answer alone as its body.

The layer emits 1351 methods over 115 classes with 9 deferred, against 1342 and
18. Its own test states that the pieces and the bins of a split arrive together
and in step, from the one call that makes them.
@estebanzimanyi
estebanzimanyi merged commit 7b6431c into MobilityDB:main Sep 3, 2026
1 check passed
@estebanzimanyi
estebanzimanyi deleted the feat/several-answers-are-one-tuple branch September 3, 2026 12:35
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