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>>
select mycol
from mytable
;
+--------------------------------------------------------------+
| mycol |
+--------------------------------------------------------------+
| {test.value={report_3=hard, report_2=normal, report_1=test}} |
+--------------------------------------------------------------+
select cast (mycol as json) as json
from mytable
;
+--------------------------------------------------------------------------+
| json |
+--------------------------------------------------------------------------+
| {"test.value":{"report_1":"test","report_2":"normal","report_3":"hard"}} |
+--------------------------------------------------------------------------+
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With