1

I'm in a bit of a dilemna here:

I'm using AWS Athena to query against some JSON objects. Most of the JSON records are structured, but one field in particular ("changes") has dynamic objects whose fields don't really have a set structure. For example, here's a record:

{
    id: 1,
    user_id: 2,
    changes: {
    "customer_id" 1,
    "business_name: ['old name', 'new name']
    }
}

Every record has different keys and the value types vary. How can I represent this data? I thought maybe a string, but when I try to store it that way I get JSON parsing errors when decoding. Any help would be appreciated! Thanks!

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Austin
  • 387
  • 6
  • 11

1 Answers1

0

This error was actually misleading. The issue was that the S3 file it was trying to query over was an array of JSON objects. This question actually resolves the issue!

Austin
  • 387
  • 6
  • 11