在 Amazon Athena 中设置多个位置

Set Multiple locations in Amazon Athena

有什么方法可以在 Amazon Athena 中为 table 设置多个位置?例如,我想从目录 's3://location-1'、's3://location-2'、's3://location-3' 等读取数据。或者使用 alter table?

添加它们

谢谢

您实际上可以为此使用分区。您唯一的限制是雅典娜现在只接受 1 个桶作为源。因此,使用您的示例,为什么不创建一个名为 "locations" 的存储桶,然后创建子目录,如 location-1、location-2、location-3,然后在其上应用分区。

这样你就可以做类似 select * from table where location = 'location-1'

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