How to store Amazon Athena Query Results into new Table?

0 votes
I need to store Amazon Athena query results into New Amazon Athena Table. Can someone help me with this?
Jan 16, 2019 in AWS by Anjali
• 2,950 points

2 answers to this question.

0 votes

This is not supported by Athena as Amazon Athena does not support INSERT or CTAS (Create Table As Select) queries.

Amazon athena stores query result in S3. Here is a documentation on how Athena works.

As Athena only points to data in S3. So once results are in S3, you can use athena to point to this as a new table.

answered Jan 16, 2019 by heena
0 votes

You can use CTAS - as Amazon Athena support it :

for example :

CREATE TABLE new_table
      format = 'Parquet',
      parquet_compression = 'SNAPPY')
FROM old_table

Amazon Athena DO support CTAS:

answered Aug 6, 2019 by Geva

Related Questions In AWS

+2 votes
1 answer
0 votes
2 answers

How to skip headers when reading a CSV file in S3 and creating a table in AWS Athena?

Thanks for the answer. This should be clear ...READ MORE

answered Aug 14, 2019 in AWS by athenauserz
0 votes
1 answer

How to upload an object into Amazon S3 in Lambda?

I suspect you are calling the context.done() function before s3.upload() has ...READ MORE

answered Sep 27, 2018 in AWS by Archana
• 4,150 points
0 votes
1 answer
+1 vote
2 answers
0 votes
1 answer

How to convert String to Date in Amazon Athena?

You can use date_parse. All you need ...READ MORE

answered Jan 16, 2019 in AWS by chandan
0 votes
1 answer

How to load data into a table in DynamoDB using Java?

You can create a .json file with the ...READ MORE

answered Feb 25, 2019 in AWS by Priyaj
• 57,700 points