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
gefragt vor einem Monat131 Aufrufe
Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen