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?

preguntada hace un año971 visualizaciones
1 Respuesta
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.

EXPERTO
respondido hace 10 meses

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