How to handle nested array in a DRUID

151 Views Asked by At

My json is as below:

{
  "id":11966121,
  "employer_id":175,
  "account_attributes":[
    {
      "id":155387028,
      "is_active":false,
      "created_at":"2018-06-06T02:12:25.243Z",
      "updated_at":"2021-03-15T17:38:04.598Z"
    },
    {
      "id":155387062,
      "is_active":true,
      "created_at":"2018-06-06T02:12:25.243Z",
      "updated_at":"2021-03-15T17:38:04.598Z"
    }
  ],
  "created_at":"2017-12-13T18:31:04.000Z",
  "updated_at":"2021-03-14T23:50:43.180Z"
}

I want to parse the message and have a table with flatten account_attributes

Considering the sample payload the o/p should have two rows:

id      |account_attributes_id| is_active | created_at             | updated_at|

11966121|155387028|false      |2018-06-06T02:12:25.243Z|2021-03-15T17:38:04.598Z |

11966121|155387062|true       |2018-06-06T02:12:25.243Z|2021-03-15T17:38:04.598Z |

Is this possible?

0

There are 0 best solutions below