AWS Athena查询一些已移动到Glacier的混合JSON对象



我有一个指向JSON对象列表的Athena表,类似于:

CREATE EXTERNAL TABLE `example_table` (
`foo` struct<
`bar`: string>
)
ROW FORMAT SERDE 
'org.openx.data.jsonserde.JsonSerDe'
WITH SERDEPROPERTIES (
'ignore.malformed.json' = 'true'
)
LOCATION 
's3://bucket/json';

这个bucket有一个生命周期策略,这样特定年龄的文件就可以进入Glacier。我想查询其他文件,但看到以下错误:

Your query has the following error(s):
HIVE_CURSOR_ERROR: com.amazonaws.services.s3.model.AmazonS3Exception: 
The operation is not valid for the object's storage class (
Service: Amazon S3; 
Status Code: 403; 
Error Code: InvalidObjectState;

AWS声称根据此更新忽略冰川物体(2/2019(:https://docs.aws.amazon.com/athena/latest/ug/release-note-2019-02-18.html

我没有得到拒绝访问,而是InvalidObjectState。如何创建一个表来查询这些JSON文件?

您的物品是冰川还是冰川深档案。似乎没有忽略DEEP_ARCHIVE的存储类。

您是否在那里?您可以使用日期-时间格式(即2020/05/14/blob.json(构造密钥。如果你能做到这一点,那么你就可以对你的数据进行分区,这将阻止你使用已经被生命周期规则修改的数据。

其他URL

  • https://docs.aws.amazon.com/athena/latest/ug/partitions.html

最新更新