Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to efficiently append new data to table in AWS Athena?

I have a table in Athena that is created from a csv file stored in S3 and I am using Lambda to query it. But I have incoming data being processed by the lambda function and want to append a new row to the existing table in Athena. How can I do this? Because I saw in documentation that Athena prohibits some SQL statements like INSERT INTO and CREATE TABLE AS SELECT

like image 283
CrashingWater Avatar asked Oct 17 '25 18:10

CrashingWater


1 Answers

If you are adding new data you can save the new data file into the same folder (prefix/key) that the table is in reading from. Athena will read from all files in this folder, the format of the new file just needs to be the same as the existing one.

like image 148
marshpipes Avatar answered Oct 20 '25 09:10

marshpipes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!