Reputation: 363
Is there any way to set multiple location for a table in Amazon Athena? For instance I want to read data from directory 's3://location-1', 's3://location-2', 's3://location-3' etc. Or add them using alter table?
Thanks
Upvotes: 2
Views: 4925
Reputation: 26
You can actually use partitions for this. Your only limitation is that athena right now only accepts 1 bucket as the source. So using your example, why not create a bucket called "locations", then create sub directories like location-1, location-2, location-3 then apply partitions on it.
That way you can do something like select * from table where location = 'location-1'
See http://docs.aws.amazon.com/athena/latest/ug/partitions.html
Upvotes: 1