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 年前971 查看次数
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 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则