← Back to team overview

maria-developers team mailing list archive

Re: MDEV-17399 Add support for JSON_TABLE: for ORDINALITY

 

On Sun, Apr 19, 2020 at 06:15:48PM +0300, Sergey Petrunia wrote:
> 
> https://gist.github.com/spetrunia/d4d8564a3ed26148ae92035b24e1f294
> 
> SELECT 
>   jt.rowseq, jt.name, jt.zip
> FROM 
>   bookclub,
>   JSON_TABLE(bookclub.jcol, "lax $"
>              COLUMNS ( rowSeq FOR ORDINALITY,
>                       name VARCHAR(30) PATH 'lax $.Name',
>                       zip CHAR(5) PATH 'lax $.address.postalCode')
>             ) AS jt
> 
> +--------+---------+------+
> | rowseq | name    | zip  |
> +--------+---------+------+
> |      0 | John Sm | 1    |
> |      1 | Peter W | 9    |
> |      2 | James L | NULL |
> +--------+---------+------+

Another question is why the names got truncated? (See the gist for the full
example).

BR
 Sergei
-- 
Sergei Petrunia, Software Developer
MariaDB Corporation | Skype: sergefp | Blog: http://s.petrunia.net/blog




References