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
preguntada hace un mes137 visualizaciones
No hay respuestas

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas