State on each SQL signature that it returns a set - #149
Merged
estebanzimanyi merged 1 commit intoSep 30, 2026
Merged
Conversation
A signature declared RETURNS SETOF carries retSet, PostgreSQL's proretset,
beside ret, the type of one of its rows: unnest(intset) is
{args: [intset], ret: integer, retSet: true, sqlName: unnest}, while
getValues(intset), over the same intset_values, returns one integer[] and
carries no retSet. The RETURNS match of _create_fn_stmts captures SETOF
instead of dropping it, the signatures of one function are told apart by it,
and a bound literal is matched to its signature with it.
Why. Flink and Spark carry a set-returning signature as one function
returning an array that the query unfolds into rows, and a signature
returning one value as a scalar function. The row type alone does not tell
the two apart, and the C shape does not either: an array return backs
getValues as much as unnest.
Measured. Over MobilityDB a362004728, 136 SQL signatures carried by 80
functions state retSet: unnest, the splits, the tiles, the …Pairs kernels,
frechetDistancePath, dynTimeWarpPath and dumpAsPolygons. The catalog is
otherwise identical to the one derived without the change.
Witness. tests/test_sqlfn_setof.py reads SETOF in either case, keeps it
apart from the row type, and states it on the unnest signature of
intset_values and not on its getValues signature.
estebanzimanyi
force-pushed
the
catalog/setof-signatures
branch
from
September 30, 2026 12:58
bcb9a15 to
2ff6988
Compare
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.
A signature declared RETURNS SETOF carries retSet, PostgreSQL's proretset,
beside ret, the type of one of its rows: unnest(intset) is
{args: [intset], ret: integer, retSet: true, sqlName: unnest}, while
getValues(intset), over the same intset_values, returns one integer[] and
carries no retSet. The RETURNS match of _create_fn_stmts captures SETOF
instead of dropping it, the signatures of one function are told apart by it,
and a bound literal is matched to its signature with it.
Why. Flink and Spark carry a set-returning signature as one function
returning an array that the query unfolds into rows, and a signature
returning one value as a scalar function. The row type alone does not tell
the two apart, and the C shape does not either: an array return backs
getValues as much as unnest.
Measured. Over MobilityDB a362004728, 136 SQL signatures carried by 80
functions state retSet: unnest, the splits, the tiles, the …Pairs kernels,
frechetDistancePath, dynTimeWarpPath and dumpAsPolygons. The catalog is
otherwise identical to the one derived without the change.
Witness. tests/test_sqlfn_setof.py reads SETOF in either case, keeps it
apart from the row type, and states it on the unnest signature of
intset_values and not on its getValues signature.