Looks like you don't have sufficient permissions to write the results to the query result bucket. Please refer the following link for more details, and it could be any of the reasons listed below...
"You get an "Access Denied" error usually because of the following reasons:
- The AWS Identity and Access Management (IAM) user doesn't have one or more of the following permissions:
- Read the source data bucket.
- Write the results to the query result bucket.*
- The Amazon Simple Storage Service (Amazon S3) bucket policies don't allow the required permissions to the IAM user.
- The object owner is different from the Amazon S3 bucket owner.
- You don't have access to the AWS Key Management Service (AWS KMS) key that's used to read or write the encrypted data.
- The AWS Glue Data Catalog policy doesn't allow access to the IAM user."
Check out the link for more details regarding the potential issues and how to solve them... https://aws.amazon.com/premiumsupport/knowledge-center/access-denied-athena/
- Accepted Answerasked 2 years ago
- How can I store an Amazon Athena query output in a format other than CSV, such as a compressed format?AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 5 months ago