How to set Multiple locations in Athena

0 votes
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 is there a way to add them using alter table?

Thanks in advance.
Jan 16, 2019 in AWS by Anjali
• 2,950 points
3,987 views

1 answer to this question.

0 votes

Unfortunately you can use athena with just one location. 

To suffice your query 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 this documentation for more information on Partitions http://docs.aws.amazon.com/athena/latest/ug/partitions.html

Hope this helps.

answered Jan 16, 2019 by william

Related Questions In AWS

0 votes
1 answer

How to delete / drop multiple tables in AWS athena?

It is not possible to run multiple ...READ MORE

answered Jan 17, 2019 in AWS by Edureka
• 4,220 points
8,203 views
+1 vote
1 answer
0 votes
1 answer
+2 votes
1 answer

How to combine multiple S3 objects in the target S3 object w/o leaving S3

"However sometimes our raw objects are not ...READ MORE

answered Aug 28, 2018 in AWS by Priyaj
• 58,020 points
12,952 views
0 votes
1 answer
+1 vote
2 answers
0 votes
1 answer

How to provide tags for the stack in CloudFormation Template?

In the template anatomy, you cant set ...READ MORE

answered Aug 13, 2018 in AWS by bug_seeker
• 15,510 points
19,578 views
0 votes
1 answer

In Amazon Data Pipeline, how to make sure only once instance of a pipeline is running at any time?

On the CopyTablesActivity, you could set a lateAfterTimeout attribute ...READ MORE

answered Sep 19, 2018 in AWS by Priyaj
• 58,020 points
2,164 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP