[MDEV-25875] JSON_TABLE: extract document fragment into JSON column Created: 2021-06-08 Updated: 2022-08-17 Resolved: 2022-05-31 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | JSON |
| Fix Version/s: | 10.6.9 |
| Type: | Task | Priority: | Blocker |
| Reporter: | Sergei Petrunia | Assignee: | Rucha Deodhar |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Description |
|
Currently, JSON_TABLE doesn't allow one to extract a JSON "subdocument" into a JSON column. Both the SQL Standard and MySQL-8 provide this capability. This task is about implementing it. I was sent a patch with MySQL-8 syntax support, so I assume we're going to implement MySQL-8 compatible syntax, which is just to allow specifying column type as JSON. For example:
should emit [1,2,3,4]. |
| Comments |
| Comment by Sergei Petrunia [ 2021-06-08 ] | |||||||||||||||||
|
First patch: | |||||||||||||||||
| Comment by Sergei Petrunia [ 2021-06-08 ] | |||||||||||||||||
|
Review input: https://lists.launchpad.net/maria-developers/msg12761.html | |||||||||||||||||
| Comment by Sergei Petrunia [ 2021-06-09 ] | |||||||||||||||||
|
For the record, the SQL Standard's way of extracting JSON documents is as Columns can be either "regular" (this is what is currently supported), or
Regular columns are just name-datatype:
Formatted columns have more options:
one can produce an empty array or empty object in on-error and on-empty conditions, etc. | |||||||||||||||||
| Comment by Alexey Botchkov [ 2021-06-16 ] | |||||||||||||||||
|
https://github.com/MariaDB/server/commit/fe0dc6ba769dcb468b37a8c3e3c636c0049f7307 | |||||||||||||||||
| Comment by Sergei Petrunia [ 2022-02-18 ] | |||||||||||||||||
|
Review input:
Please fix the typo, SON_TABLE.
Please use { } brackets as the statement inside the if takes multiple lines. Ok to push after the above is addressed. | |||||||||||||||||
| Comment by Rucha Deodhar [ 2022-05-19 ] | |||||||||||||||||
|
Patch for community server: Patch1 and fixup for Patch 1 | |||||||||||||||||
| Comment by Sergei Petrunia [ 2022-05-27 ] | |||||||||||||||||
|
Hi Rucha, Please change the commit title (of both commits) to mention ok to push after that is done. | |||||||||||||||||
| Comment by Rucha Deodhar [ 2022-05-31 ] | |||||||||||||||||