2017-04-21 136 views
2

在S3存儲桶上運行Amazon Athena查詢時,出現以下錯誤。Amazon Athena - S3位置錯誤

我在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'); 

返回錯誤:

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) 

回答

2

亞馬遜雅典娜保存每個查詢在一個Amazon S3桶的輸出。錯誤消息是說Athena無法訪問此存儲桶。

Settings link

  • 點擊Settings鏈接屏幕
  • 驗證桶名稱顯示的頂部(如果你想隨意改變它)
  • 驗證在亞馬遜S3管理控制檯,該名稱的存儲桶存在於同一個區域中。如果沒有,請創建存儲桶。

Bucket name