Skip to content

State the C value feeding a row column two C values of its type fit - #171

Merged
estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:catalog/stated-row-column-takes-its-source
Oct 4, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:catalog/stated-row-column-takes-its-source

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

meta/sql-columns.json states, beside the ordinal and the offset a wrapper computes, the C value
feeding a column where the types leave it open: "from" is "return" or the name of an
out-parameter, and the column takes that value. A statement naming no C value of the function
stops the catalog, as a column nothing feeds does. jsonbEachText states its key from the
returned array and its value from the out-parameter values.

Witness: jsonb_each_text returns its keys and fills its values, both text, and jsonbEachText
returns rows (key text, value text). Over a MobilityDB tree deploying jsonbEachText, run.py
stops with "SQL rows with a column MEOS states no source for ... jsonb_each_text:
jsonbEachText(jsonb) RETURNS record", since both C values fit both columns. With this change
the catalog reads key from return and value from values.

Why: matching a column by type refuses to choose between two C values of one type, and it must,
since the SQL column order and the C parameter order need not agree; the source is then a fact
only the function's author knows, and meta/sql-columns.json is where the catalog reads such
facts. A statement that only skipped its column, as the ordinal does, left both C values unfed.

Measured: over MobilityDB 453039dd6c the catalog run.py derives with this change is
byte-identical to the one it derives without it. Over the MobilityDB branch
meos/host-base-sqlfn it derives, where it stopped before, and jsonbEachText carries the columns
above. tests/test_sqlfn_rows.py states that two C values of one type need a statement, that a
statement feeds its column, and that a statement naming no C value stops the catalog; the suite
passes 487 tests with none skipped, above the floor of 469.

meta/sql-columns.json states, beside the ordinal and the offset a wrapper computes, the C value
feeding a column where the types leave it open: "from" is "return" or the name of an
out-parameter, and the column takes that value. A statement naming no C value of the function
stops the catalog, as a column nothing feeds does. jsonbEachText states its key from the
returned array and its value from the out-parameter values.

Witness: jsonb_each_text returns its keys and fills its values, both text, and jsonbEachText
returns rows (key text, value text). Over a MobilityDB tree deploying jsonbEachText, run.py
stops with "SQL rows with a column MEOS states no source for ... jsonb_each_text:
jsonbEachText(jsonb) RETURNS record", since both C values fit both columns. With this change
the catalog reads key from return and value from values.

Why: matching a column by type refuses to choose between two C values of one type, and it must,
since the SQL column order and the C parameter order need not agree; the source is then a fact
only the function's author knows, and meta/sql-columns.json is where the catalog reads such
facts. A statement that only skipped its column, as the ordinal does, left both C values unfed.

Measured: over MobilityDB 453039dd6c the catalog run.py derives with this change is
byte-identical to the one it derives without it. Over the MobilityDB branch
meos/host-base-sqlfn it derives, where it stopped before, and jsonbEachText carries the columns
above. tests/test_sqlfn_rows.py states that two C values of one type need a statement, that a
statement feeds its column, and that a statement naming no C value stops the catalog; the suite
passes 487 tests with none skipped, above the floor of 469.
@estebanzimanyi
estebanzimanyi merged commit 441f98e into MobilityDB:master Oct 4, 2026
3 checks passed
@estebanzimanyi
estebanzimanyi deleted the catalog/stated-row-column-takes-its-source branch October 4, 2026 11:07
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