MeltanoLabs / target-athena

Singer.io Target for AWS Athena.
Other
5 stars 16 forks source link

Replacing / updating Athena table definitions #4

Open andrewcstewart opened 3 years ago

andrewcstewart commented 3 years ago

Currently tables are created with CREATE EXTERNAL TABLE IF NOT EXISTS {database}.{table}, but one may want to replace or update an existing table definition.

andrewcstewart commented 3 years ago

There are a few options here:

1) Simply DROP TABLE prior to CREATE TABLE as part of table creation. 2) DROP TABLE but conditional on whether table exists (test via SHOW TABLES) 3) test if table exists, if so then ALTER TABLE REPLACE COLUMNS. 4) possibly perform other ALTER TABLE operations for other table creation statements (like serde).