Cannot query Athena tables as the Glue crawler generated data having = instead of : in the column values

0

I have created tables in Athena using Crawler to run on S3 path having GZ file format data, the table is generated but has data with = between key value pairs than : between them

Sample data from table:

payload={x=[{y={z=123, code=null, p=null, q=null}}],r=10}

I can query the data by dot for some, but for the ones inside array I am unable to use json_extract functions.

How can I add the separator as : instead of = or make some change in Athena while querying to extract values from array ?

已提問 2 年前檢視次數 454 次
1 個回答
0

This issue seems to be related to source data. During my replication I found that the input data should be something like below to get the output you are seeing Athena.

{"string": "payload={x=[{y={z=123, code=null, p=null, q=null}}],r=10}"}

Also, please note that Athena only reads json files that confirm with formats mentioned in [1]. Hence, request you to please reach out to support engineering with your input data to better understand the issue at hand.

————————

Reference:

[1] https://aws.amazon.com/premiumsupport/knowledge-center/error-json-athena/

================

Have a nice day!

AWS
支援工程師
Arun
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南