Amazon athena can't read S3 JSON Object files and Athena select query returns empty result sets for JSON key columns Amazon athena can't read S3 JSON Object files and Athena select query returns empty result sets for JSON key columns json json

Amazon athena can't read S3 JSON Object files and Athena select query returns empty result sets for JSON key columns


The JSON must be in a single line, as mentioned in this page of the AWS Athena documentation. You can have multiple JSON objects on separate lines, but each complete object must only span one line.

Example (this could all be in one S3 object):

{"devId": "a1", "type": "b1", "status": "c1"}{"devId": "a2", "type": "b2", "status": "c2"}


Glue can read multi-line json objects because it has spark engine under the hood. One workaround is, transform those json objects to parquet using glue if you can't easily make those json objects on line.


Use jsonlines to convert JSON to jsonlines and then Athena will be able to fetch all row.