Ridwan
Ridwan

Reputation: 363

Set Multiple locations in Amazon Athena

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

Answers (1)

Cris
Cris

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

Related Questions