Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zero Downtime options for table materialization #73

Closed
nicor88 opened this issue Dec 1, 2022 · 4 comments · Fixed by #246
Closed

Zero Downtime options for table materialization #73

nicor88 opened this issue Dec 1, 2022 · 4 comments · Fixed by #246
Labels
enhancement New feature or request
Milestone

Comments

@nicor88
Copy link
Contributor

nicor88 commented Dec 1, 2022

See this PR: Tomme/dbt-athena#95

Also using iceberg should be quit easy:

ALTER TABLE target RENAME TO target_bkp;
ALTER TABLE target_tmp RENAME TO target;

DROP target_bkp; -- only if all is fine

It's not 100% downtime, but almost.

Regarding not iceberg table we can do something like this:

@nicor88 nicor88 added enhancement enhancement New feature or request labels Dec 1, 2022
@Jrmyy
Copy link
Contributor

Jrmyy commented Dec 20, 2022

Right now it is not possible to use the rename command since the rename actually works but an error is raised because results can't be found according to athena API.

A case has been opened by my company on AWS. They are investigation.

@hiltercoty
Copy link

hiltercoty commented Jan 24, 2023

This can be done by using views but Athena views are not supported by either Spark or Redshift, which causes trouble in my use-case.

Another approach could be using the ALTER TABLE SET LOCATION 'new location' command. The same table can be created in a different folder like a partition and once the data is ready, the table location can be updated.

With this approach metadata (partition information) would mostly be the same but to cover everything MSCK REPAIR TABLE can be executed after the alter command.

@nicor88
Copy link
Contributor Author

nicor88 commented Feb 20, 2023

@hiltercoty we merged the feature to address ha for hive tables.
Iceberg support for ha is still on on-hold as we are missing an alter table rename working properly.

@nicor88
Copy link
Contributor Author

nicor88 commented Apr 20, 2023

As found by @Jrmyy this issue is not longer blocked as the athena team fixed the ALTER TABLE target RENAME TO statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants