Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

284
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda