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 ?

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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠