Amazon Athena - S3 位置错误

Man*_*eni 5 amazon-s3 amazon-web-services amazon-athena

我在 S3 存储桶上运行 Amazon Athena 查询时遇到以下错误。

我正在 CloudFront 访问日志上运行此查询。

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');
Run Code Online (Sandbox Code Playgroud)

返回错误:

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)
Run Code Online (Sandbox Code Playgroud)

Joh*_*ein 7

Amazon Athena 将每个查询的输出保存在 Amazon S3 存储桶中。错误消息表明 Athena 无法访问此存储桶。

设置链接

  • 单击Settings屏幕顶部的链接
  • 验证是否显示存储桶名称(如果您愿意,可以随意更改)
  • 在 Amazon S3 管理控制台中验证同一区域中是否存在同名的存储桶。如果没有,请创建存储桶。

桶名称