File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,14 @@ select
7575 group_concat(
7676 ' select ' || char (10 ) ||
7777 (
78- with t as (select * from json_tree(top .value )),
78+ with t as (
79+ select * ,
80+ case type
81+ when ' array' then json_array_length(json_array(value))> 1
82+ else false
83+ end as is_arr
84+ from json_tree(top .value )
85+ ),
7986 key_val as (select
8087 CASE t .type
8188 WHEN ' integer' THEN t .atom
9299 ELSE parent .key
93100 END as key
94101 from t inner join t parent on parent .id = t .parent
95- where ((parent .fullkey = ' $' and t . type != ' array ' )
96- or (parent .type = ' array ' and parent .path = ' $ ' ))
102+ where ((parent .fullkey = ' $' and not t . is_arr )
103+ or (parent .path = ' $ ' and parent .is_arr ))
97104 ),
98105 key_val_padding as (select
99106 CASE
You can’t perform that action at this time.
0 commit comments