aws athena – cast as json don’t return json object

Question:

I have a list of json objects (result attribute) as in the example :

I get :

I try to get this attribute as json object (without “=”) so I can use the results in my application that take only json data.

I try the function cast (myattribute as json) :

But, I get :

As you see, the keys are omitted !
Any help?

Answer:

That’s because it’s stored as a ROW type field and not JSON. You can access the different keys by doing

select field.key from table

You can check more about it in here

Leave a Reply