Skip to content

Generate the path functions of a plain jsonb - #508

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:gen/base-jsonb-path-arg
Oct 26, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:gen/base-jsonb-path-arg

Conversation

@estebanzimanyi

@estebanzimanyi estebanzimanyi commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

The path functions read the path as a list of text over a plain jsonb as they do over a temporal and a set: jsonbSet, jsonbInsert, jsonbDeletePath, jsonbDeleteArray and jsonbExtractPath take the jsonb, the path as LIST(VARCHAR) and the arguments MobilityDB declares after it, and answer a jsonb, NULL where MEOS answers none. The text-array shape admits a base value as its operand, reads it with the base value's own blob reader, answers through its own {Base}ToBlobN and registers over its own type, as the base-value scalars do.

Witness: the five functions answer {"a": [9, 2]}, {"a": [1, 9, 2]}, {"a": {"c": 2}}, {"b": 2} and [1, 2] on the arrays and objects of test/sql/parity/027_tjsonb.test, jsonbExtractPath of a key the object does not hold answers NULL, and jsonbSet over three rows answers NULL for the row whose value is NULL and each other row its own value. The generator adds these five registrations and removes none.

The path functions read the path as a list of text over a plain jsonb as they do over a temporal and a set: jsonbSet, jsonbInsert, jsonbDeletePath, jsonbDeleteArray and jsonbExtractPath take the jsonb, the path as LIST(VARCHAR) and the arguments MobilityDB declares after it, and answer a jsonb, NULL where MEOS answers none. The text-array shape admits a base value as its operand, reads it with the base value's own blob reader, answers through its own {Base}ToBlobN and registers over its own type, as the base-value scalars do.

Witness: the five functions answer {"a": [9, 2]}, {"a": [1, 9, 2]}, {"a": {"c": 2}}, {"b": 2} and [1, 2] on the arrays and objects of test/sql/parity/027_tjsonb.test, jsonbExtractPath of a key the object does not hold answers NULL, and jsonbSet over three rows answers NULL for the row whose value is NULL and each other row its own value. The generator adds these five registrations and removes none.
@estebanzimanyi
estebanzimanyi force-pushed the gen/base-jsonb-path-arg branch from 7123152 to 9f4b4ab Compare October 26, 2026 13:13
@estebanzimanyi
estebanzimanyi marked this pull request as ready for review October 26, 2026 13:37
@estebanzimanyi
estebanzimanyi merged commit 58ad1e0 into MobilityDB:main Oct 26, 2026
9 checks passed
@estebanzimanyi
estebanzimanyi deleted the gen/base-jsonb-path-arg branch October 26, 2026 13:38
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