Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

279
Views
Is there any way we can run multiple SQL queries at the same time in Athena Database

I have to create 20 table in a Athena data base at the same time. Can I do it with a single execution.

example :

CREATE EXTERNAL TABLE IF NOT EXISTS database_1.A 
; 
CREATE EXTERNAL TABLE IF NOT EXISTS database_1.B
;
CREATE EXTERNAL TABLE IF NOT EXISTS database_1.C
over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

I have used aws cli for such problems. create a list of sqls.

sql_list.txt
CREATE EXTERNAL TABLE IF NOT EXISTS database_1.A; 
CREATE EXTERNAL TABLE IF NOT EXISTS database_1.B;
CREATE EXTERNAL TABLE IF NOT EXISTS database_1.C;
----------
exec_sqls.sh
input_file=$1
while IFS= read -r sql
do
  echo "$line"
  aws athena start-query-execution --query-string "$sql" --result-configuration S3LocationForOutput=s3://<bucket>
done < "$input_file"
-----------
sh -x exec_sqls.sh sql_list.txt
over 4 years ago · Santiago Trujillo Report

0

You can submit multiple requests simultaneously to Amazon Athena (eg via different threads in your application), but each Amazon Athena command can only execute a single SQL query/command.

over 4 years ago · Santiago Trujillo Report

0

I have a similar solution but using Redshift eternal tables and Dbeaver. Changes made to external tables will be reflected automatically on Athena.

By using Dbeaver I'm able to run several DDLs on a single execution. Minor changes are required:

  • Update datatypes for each column from Athena to Redshift
  • Update database name from Athena to Redshift's schema name
  • Syntax to create partitioned tables. Only if applies
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!