Script in the terminal runs ok, running in a job at Glue return an error in athena

0

Hello, so I have my script that runs an Athena query and sends an email,

When I was testing in my machine in the terminal, running 'python3 name-file.py'. The script works fine, the query is run and the email (that I'm forcing is sent). But we want to automate that, and I created a job in Glue when I run the script on Glue I get an error in Athena recent querys 'TABLE_NOT_FOUND: line 2:21: Table 'awsdatacatalog.produtos-digitais.i_izio_transacoes_loja' does not exist' why this is happening?

the call of the athena:

def get_run_id(): query = '''SELECT partition_0, count(distinct "$path") FROM "i_izio_transacoes_loja" WHERE date("$file_modified_time") = current_date GROUP BY 1 LIMIT 4'''

 response = athena.start_query_execution(
 QueryString=query,
 QueryExecutionContext={
     'Database': 'produtos-digitais',
 },
 ResultConfiguration={
     'OutputLocation': 's3://my-output/',
 }

) return response["QueryExecutionId"]

  • Sorry, don't know how to fix the code to be more readable

Marcelo
feita há um mês137 visualizações
Sem respostas

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas