python - Handling Nested Arrays/List in JSON return with fjsonparser in Vertica -


i'm running issue , cannot find way handle it. i'll provide example.

say i'm making api call amtrack using python requests information tickets. return coming in json format this:

{    "tickets": [     {       "id":               12345,       "external_id":      "abcdefg",       "created_at":       "2015-04-27t22:55:29z",       "updated_at":       "2015-04-27t10:38:52z",       "type":             "commuter",       "priority":         "high",       "status":           "open",       "recipient":        "amanda",       "requester_id":     1234567,       "route_id":      1234567,       "tags":             ["round-trip", "commuter"],       "via": {         "channel": "web"       },       "custom_fields": [         {           "id":    27642,           "value": "commuter ticket"         },         {           "id":    27648,           "value": "reoccuring charge"         }       ],      } } 

i generating json file 1,000,000 tickets.

i want put vertica table, use built in fjsonparser, , goes great, except custom_fields key. can table, column full of barely readable garbage can't put text here.

i'm trying figure way handle this. need data inside custom_fields, because of formatting, parsing string not feasible. considered adding custom fields own json file when write file after api pull. like:

cf_list = data['tickets']['custom_fields']  open(filepath, mode='w') f:         json.dump(cf_list, f) 

the problem here have no way of tying custom_fields ticket came from. i'm needing help.

thanks!

add flatten_arrays=true fjsonparser. flatten nested arrays.