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?

已提問 1 年前檢視次數 970 次
1 個回答
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.

專家
已回答 10 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南