pgsql: JSON_TABLE: Add support for NESTED paths and columns

Поиск
Список
Период
Сортировка
От Amit Langote
Тема pgsql: JSON_TABLE: Add support for NESTED paths and columns
Дата
Msg-id E1rtjE5-0015UB-2S@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
JSON_TABLE: Add support for NESTED paths and columns

A NESTED path allows to extract data from nested levels of JSON
objects given by the parent path expression, which are projected as
columns specified using a nested COLUMNS clause, just like the parent
COLUMNS clause.  Rows comprised from a NESTED columns are "joined"
to the row comprised from the parent columns.  If a particular NESTED
path evaluates to 0 rows, then the nested COLUMNS will emit NULLs,
making it an OUTER join.

NESTED columns themselves may include NESTED paths to allow
extracting data from arbitrary nesting levels, which are likewise
joined against the rows at the parent level.

Multiple NESTED paths at a given level are called "sibling" paths
and their rows are combined by UNIONing them, that is, after being
joined against the parent row as described above.

Author: Nikita Glukhov <n.gluhov@postgrespro.ru>
Author: Teodor Sigaev <teodor@sigaev.ru>
Author: Oleg Bartunov <obartunov@gmail.com>
Author: Alexander Korotkov <aekorotkov@gmail.com>
Author: Andrew Dunstan <andrew@dunslane.net>
Author: Amit Langote <amitlangote09@gmail.com>
Author: Jian He <jian.universality@gmail.com>

Reviewers have included (in no particular order):

Andres Freund, Alexander Korotkov, Pavel Stehule, Andrew Alsup,
Erik Rijkers, Zihong Yu, Himanshu Upadhyaya, Daniel Gustafsson,
Justin Pryzby, Álvaro Herrera, Jian He

Discussion: https://postgr.es/m/cd0bb935-0158-78a7-08b5-904886deac4b@postgrespro.ru
Discussion: https://postgr.es/m/20220616233130.rparivafipt6doj3@alap3.anarazel.de
Discussion: https://postgr.es/m/abd9b83b-aa66-f230-3d6d-734817f0995d%40postgresql.org
Discussion: https://postgr.es/m/CA+HiwqE4XTdfb1nW=Ojoy_tQSRhYt-q_kb6i5d4xcKyrLC1Nbg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/bb766cde63b4f624d029b34c9cdd3d0a94fd5b46

Modified Files
--------------
doc/src/sgml/func.sgml                             | 154 ++++++++-
src/backend/catalog/sql_features.txt               |   2 +-
src/backend/nodes/nodeFuncs.c                      |   2 +
src/backend/parser/gram.y                          |  38 +-
src/backend/parser/parse_jsontable.c               | 150 +++++++-
src/backend/utils/adt/jsonpath_exec.c              | 168 ++++++++-
src/backend/utils/adt/ruleutils.c                  |  60 +++-
src/include/nodes/parsenodes.h                     |   2 +
src/include/nodes/primnodes.h                      |  34 +-
src/include/parser/kwlist.h                        |   1 +
.../ecpg/test/expected/sql-sqljson_jsontable.c     |  14 +-
.../test/expected/sql-sqljson_jsontable.stderr     |   8 +
.../test/expected/sql-sqljson_jsontable.stdout     |   1 +
src/interfaces/ecpg/test/sql/sqljson_jsontable.pgc |   8 +
src/test/regress/expected/sqljson_jsontable.out    | 385 +++++++++++++++++++++
src/test/regress/sql/sqljson_jsontable.sql         | 210 +++++++++++
src/tools/pgindent/typedefs.list                   |   1 +
17 files changed, 1207 insertions(+), 31 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: pgsql: Enhance libpq encryption negotiation tests with new GUC
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: pgsql: Transform OR clauses to ANY expression