- Un-nest
t0.b.ba.innermost
- Relabel
t0.b.innermost
to"bd"
- Nest key
t0.c
under"b"
- Relabel
t0.b.c
to"be"
Created
November 24, 2017 18:02
-
-
Save garyb/6ffc22924376c59ef28b128660371ae8 to your computer and use it in GitHub Desktop.
Structure edits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "a": 1, "b": { "ba": { "innermost": true }, "bb": ["x", false, { "foo": "bar" }], "bc": 0.5 }, "c": [] } | |
{ "a": 2, "b": { "ba": { "innermost": false }, "bb": ["y", true, { "foo": "baz" }], "bc": 60 }, "c": [true, false, "maybe"] } | |
{ "a": 3, "b": { "ba": true, "bb": ["z", { "foo": "quux" }] }, "c": null } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT MAP_CONCAT(t3, {"b": MAP_CONCAT(DELETE_KEY(t3.b, "c"), {"be": MAP_CONCAT(t3.b.be, t3.b.c) ?? t3.b.c}) ?? t3.b}) ?? t3 FROM (SELECT MAP_CONCAT(DELETE_KEY(t2, "c"), {"b": MAP_CONCAT(t2.b, {"c": MAP_CONCAT(t2.b.c, t2.c) ?? t2.c}) ?? {"c": t2.c}}) ?? t2 FROM (SELECT MAP_CONCAT(t1, {"b": MAP_CONCAT(DELETE_KEY(t1.b, "innermost"), {"bd": MAP_CONCAT(t1.b.bd, t1.b.innermost) ?? t1.b.innermost}) ?? t1.b}) ?? t1 FROM (SELECT MAP_CONCAT(t0, {"b": MAP_CONCAT(DELETE_KEY(t0.b, "ba"), {"ba": DELETE_KEY(t0.b.ba, "innermost") ?? t0.b.ba, "innermost": MAP_CONCAT(t0.b.innermost, t0.b.ba.innermost) ?? t0.b.ba.innermost}) ?? t0.b}) ?? t0 FROM :resource AS t0) AS t1) AS t2) AS t3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment