How can I get result format JSON from Athena in AWS?

Viewed 8461

I want to get result value format JSON from Athena in AWS.

When I select from the Athena then the result format like this.

{test.value={report_1=test, report_2=normal, report_3=hard}}

Is there any way to get JSON format result without replacing "=" to ":" ?

The column format is

map<string,map<string,string>>
2 Answers

If your input format is json (i.e. your whole row is JSON) you can create a new table that holds athena results in whatever format you specify out of several possible options like parquet, json, orc etc. This would ultimately end up storing all athena results of your query, in an s3 bucket with the desired format.

hope this helps

here's the documentation for reference: https://docs.aws.amazon.com/athena/latest/ug/ctas-examples.html

Related