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 in AWS by Anjali
• 2,900 points
101 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 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 in AWS by Edureka
• 4,180 points
333 views
0 votes
1 answer
+1 vote
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
• 56,160 points
1,378 views
0 votes
1 answer

How to skip headers when reading a CSV file in S3 and creating a table in AWS Athena?

This is a known deficiency. The best ...READ MORE

answered Sep 4, 2018 in AWS by Archana
• 4,090 points
750 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,310 points
2,845 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
• 56,160 points
197 views