Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

S3/Athena query result location and “Invalid S3 folder location”

Are there particular requirements to the bucket for specifying the query result location? When I try to create a new table, I get a popup:

Before you run your first query, you need to set up a query result location in Amazon S3. Learn more

So I click the link and specify my query result location in the format specified s3://query-results-bucket/folder. But it always says

Invalid S3 folder location

I posted this in Superuser first but it was closed (not sure why...).

like image 769
tom Avatar asked Nov 17 '19 01:11

tom


People also ask

Where is query result location in Athena?

If you run the query using the Athena console, the Query result location entered under Settings in the navigation bar determines the client-side setting. If you run the query using the Athena API, the OutputLocation parameter of the StartQueryExecution action determines the client-side setting.

How do I query S3 with Athena?

Go to the S3 bucket where source data is stored and click on the file. Click on the Copy Path button to copy the S3 URI for file. Navigate to AWS Athena service. In the Settings tab on top-right, enter S3 Bucket name where results of Athena queries will be stored, then click Save.

What's difference between S3 query and Athena query?

So Whats the Difference Between S3 Select and Athena? S3 Select is a lightweight solution designed to let you use SQL to perform simple SELECT clauses on a maximum of one file. Amazon Athena is an analytics workhorse that allows you to perform SQL on extremely large datasets spanning many files with great performance.

Why do I get the access denied error when I run a query in Amazon Athena?

You can get an "Access Denied" error because of the following reasons: The AWS Identity and Access Management (IAM) user doesn't have one or more of the following permissions: Read the source data bucket. Write the results to the query result bucket.


1 Answers

The folder name needs to have a trailing slash:

s3://query-results-bucket/folder/
like image 79
John Rotenstein Avatar answered Sep 23 '22 03:09

John Rotenstein