Amazon Athena Location Error - S3

I am getting below error when running Amazon Athena request on S3 bucket.

I am running this query on CloudFront access logs.

CREATE EXTERNAL TABLE IF NOT EXISTS cloudfront.cf_logs (
  `date` date,
  `time` string,
  `location` string,
  `bytes` int,
  `requestip` string,
  `method` string,
  `host` string,
  `uri` string,
  `status` int,
  `referrer` string,
  `os` string,
  `browser` string,
  `browserversion` string 
)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
WITH SERDEPROPERTIES (
  'serialization.format' = '1'
) LOCATION 's3://cloudfront-access/test-sh/'
TBLPROPERTIES ('has_encrypted_data'='false');

      

Mistake:

Your query has the following error(s):

The S3 location provided to save your query results is invalid. Please
check your S3 location is correct and is in the same region and try
again. If you continue to see the issue, contact customer support for
further assistance. (Service: AmazonAthena; Status Code: 400; Error
Code: InvalidRequestException; Request ID:
f8cd2762-1e7-a2f9-e5eb1d865406)

      

+3


source to share


1 answer


Amazon Athena stores the result of each request in an Amazon S3 bucket. The error message says that Athena cannot access this bucket.

Settings link



  • Click the link Settings

    at the top of the screen
  • Make sure the bucket name is displayed (feel free to change it if you like)
  • Check in the Amazon S3 Management Console that a bucket of this name exists in the same region. If not, create a bucket.

Bucket name

+2


source







All Articles