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;
maafk
  • 6,176
  • 5
  • 35
  • 58

1 Answers1

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.

Red Boy
  • 5,429
  • 3
  • 28
  • 41