Is it possible to automate the replacement of a table in Athena?

0

I have 2 tables that are a "SELECT * FROM..." statement from their correspondant views. I update them by manually deleting the table and then creating it again using the CREATE TABLE statement.

Is there a way to automate this?

gefragt vor einem Jahr972 Aufrufe
1 Antwort
0

It's hard to tell exactly what you're trying to do based on the initial data that you provided.

Lambda and EventBridge If your queries are constant you can create a Lambda function that will interact with the AWS SDK. Additionally you could schedule the Lambda to run based on a cron expression with EventBridge (Cloud Watch Events).

Partitioned Tables If you're replacing the table to update the partition because new data was added to S3 then you can change your approach. MSCK REPAIR TABLE will update the metadata. Alternatively you can use ALTER TABLE ADD PARTITION.

Hopefully one of these approaches helps you. If they don't solve your problem, can you please elaborate on your situation and goal so that I can try to provide more appropriate help.

EXPERTE
beantwortet vor 10 Monaten

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