Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More complex flattening? #64

Open
grwhumphries opened this issue Mar 28, 2020 · 2 comments
Open

More complex flattening? #64

grwhumphries opened this issue Mar 28, 2020 · 2 comments

Comments

@grwhumphries
Copy link

Wondering if you could provide an example of a very deep nested JSON?

Something like:

{
    "results": [
        {
            "project_name": "Test",
            "start_date": "2020-03-25",
            "associated_references": [
                {
                    "full_reference": "Reference A",
                    "year": 2010,
                },
                {
                    "full_reference": "Reference B",
                    "year": 2010
                },
            ],
            "hierarchy":[{
                      "hierarchy_id": "top level event",
                       "event":[
                           {
                                  "event name": "event 1"
                            },
                            {
                                  "event name": "event 2"
                            },
                            {
                                  "event name": "event 3"
                            }]
                       },
                       {"hierarchy_id":"second level event",
                        "event":[
                           {
                                  "event name": "event 1"
                            },
                            {
                                  "event name": "event 2"
                            }
                            }]]
                             
              }]
      ]}}

The header structure to be returned here would be something like:

Project_name start_date associated_references.full_reference associated_references.year hierarchy.hierarchy_id event.event_name

In this case, the row values for each column are replicated (e.g., project_name and start_date) up to the number of instances of the sub-queries..

@crazyprogrammer
Copy link

+1

@Cor-J
Copy link

Cor-J commented Aug 28, 2020

I have a similar issue to deals with, @grwhumphries how did you deals with yours?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants