Skip to content

Commit c772f10

Browse files
author
Nikita Glukhov
committed
Add documentation for JSON_TABLE PLAN DEFAULT clause
1 parent f034fcd commit c772f10

File tree

1 file changed

+101
-17
lines changed

1 file changed

+101
-17
lines changed

doc/src/sgml/func.sgml

Lines changed: 101 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18595,6 +18595,10 @@ FROM
1859518595
JSON_TABLE (
1859618596
context_item, path_expression PASSING { value AS varname } , ...
1859718597
COLUMNS ( json_table_column , ... )
18598+
18599+
PLAN DEFAULT ( { INNER | OUTER } , { CROSS | UNION }
18600+
| { CROSS | UNION } , { INNER | OUTER } )
18601+
1859818602
)
1859918603
1860018604
where json_table_column is:
@@ -18656,7 +18660,8 @@ where json_table_column is:
1865618660
The rows produced by JSON_TABLE are laterally
1865718661
joined to the row that generated them, so you do not have to explicitly join
1865818662
the constructed view with the original table holding JSON
18659-
data.
18663+
data. Optionally, you can specify how to join the columns returned
18664+
by NESTED PATH using the PLAN DEFAULT clause.
1866018665
1866118666

1866218667
@@ -18669,22 +18674,6 @@ where json_table_column is:
1866918674
the resulting rows are joined to the parent row.
1867018675
1867118676

18672-
18673-
Columns with parent/child relationship are joined using
18674-
LEFT OUTER JOIN, so that the parent row
18675-
is always included into the output even if it does not have any child rows
18676-
after joining the data returned by NESTED PATH,
18677-
with NULL values inserted into the child columns if the corresponding
18678-
values are missing.
18679-
18680-
18681-
18682-
Sibling columns are joined using
18683-
FULL OUTER JOIN ON FALSE, so that both parent and child
18684-
rows are included into the output, with NULL values inserted
18685-
into both child and parrent columns for all missing values.
18686-
18687-
1868818677
1868918678
1869018679
Parameters
@@ -18856,6 +18845,10 @@ where json_table_column is:
1885618845
JSON_TABLE expressions in an SQL statement.
1885718846
1885818847

18848+
18849+
You can use the PLAN DEFAULT clause to define how
18850+
to join the columns returned by NESTED PATH clauses.
18851+
1885918852
1886018853
1886118854

@@ -18878,8 +18871,99 @@ where json_table_column is:
1887818871
1887918872
1888018873

18874+
18875+
18876+
PLAN DEFAULT ( option [, ... ] )
18877+
18878+
18879+
18880+
Defines how to join the data returned by NESTED PATH
18881+
clauses to the constructed view. The INNER and
18882+
OUTER options define the joining plan for parent/child
18883+
columns, while UNION and CROSS
18884+
affect the sibling columns. You can override the default plans for all
18885+
columns at once.
18886+
18887+
18888+
18889+
To join columns with parent/child relationship, you can use:
18890+
18891+
18892+
18893+
18894+
INNER
18895+
18896+
18897+
18898+
18899+
Use INNER JOIN, so that the parent row
18900+
is omitted from the output if it does not have any child rows
18901+
after joining the data returned by NESTED PATH.
18902+
18903+
18904+
18905+
18906+
18907+
18908+
OUTER
18909+
18910+
18911+
18912+
18913+
Use LEFT OUTER JOIN, so that the parent row
18914+
is always included into the output even if it does not have any child rows
18915+
after joining the data returned by NESTED PATH, with NULL values
18916+
inserted into the child columns if the corresponding
18917+
values are missing.
18918+
18919+
18920+
This is the default option for joining columns with parent/child relationship.
18921+
18922+
18923+
18924+
18925+
18926+
18927+
To join sibling columns, you can use:
18928+
18929+
18930+
18931+
18932+
18933+
UNION
18934+
18935+
18936+
18937+
18938+
Use FULL OUTER JOIN ON FALSE, so that both parent and child
18939+
rows are included into the output, with NULL values inserted
18940+
into both child and parrent columns for all missing values.
18941+
18942+
18943+
This is the default option for joining sibling columns.
18944+
18945+
18946+
18947+
18948+
18949+
18950+
CROSS
18951+
18952+
18953+
18954+
18955+
Use CROSS JOIN, so that the output includes
18956+
a row for every possible combination of rows from the left-hand
18957+
and the right-hand columns.
18958+
18959+
18960+
18961+
1888118962
1888218963

18964+
18965+
18966+
1888318967
1888418968

1888518969

0 commit comments

Comments
 (0)