1

I have a .sql file filled with Athena queries.

Is there a way I can tell Athena to run the sql queries saved in s3://my-bucket/path/to/queries.sql?

In MySQL can do something like this (based in SO answer), but curious if possible in Athena

mysql> source \home\user\Desktop\test.sql;

1 Answer 1

1

Is there a way I can tell Athena to run the sql queries saved in s3://my-bucket/path/to/queries.sql?

I think there is no direct way to tell Athena to run query stored in S3.

In MySQL can do something like this (based in SO answer), but curious if possible in Athena.

If you want to do it at all, then yes, you should be able to run the query using AWS CLI. Your steps should be look like this.

  1. Get the query from S3 using CLI and store in temp variable
  2. Pass the query stored in a temp variable to Athena Query CLI

Hope this will help.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.