Reputation: 14216
I am currently working with AWS-Athena and it does not support CREATE TABLE AS
which is fine so I thought I would approach it by doing INSERT OVERWRITE DIRECTORY S3://PATH
and then loading from S3
but apparently that doesn't seem to work either. How would I create a table from a query if both of these options are out the window?
Upvotes: 1
Views: 111
Reputation: 269111
Amazon Athena is read-only. It cannot be used to create tables in Amazon S3.
However, the output of an Amazon Athena query is stored in Amazon S3 and could be used as input for another query. However, you'd have to know the path of the output.
Amazon Athena is ideal for individual queries against data stored in Amazon S3, but is not the best tool for ETL actions, which typically involve transforming data, storing it and then sequentially processing it again.
Upvotes: 2
Reputation: 44921
You don't have to use INSERT, just create an external table over the location of the previous query results
https://aws.amazon.com/premiumsupport/knowledge-center/athena-query-results/
Upvotes: 0