Skip to content

Commit

Permalink
drop like in ctas to avoid copying expiry metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
z3z1ma authored Jun 8, 2023
1 parent e1b4ee1 commit ed46a26
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions target_bigquery/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,8 @@ def clean_up(self) -> None:
target = self.overwrite_target.as_table()
self.client.query(
f"DROP TABLE IF EXISTS {self.overwrite_target.get_escaped_name()}; CREATE TABLE"
f" {self.overwrite_target.get_escaped_name()} LIKE"
f" {self.table.get_escaped_name()} AS SELECT * FROM"
f" {self.table.get_escaped_name()};DROP TABLE IF EXISTS"
f" {self.overwrite_target.get_escaped_name()} AS SELECT * FROM"
f" {self.table.get_escaped_name()}; DROP TABLE IF EXISTS"
f" {self.table.get_escaped_name()};"
).result()
self.table = self.merge_target
Expand Down

0 comments on commit ed46a26

Please sign in to comment.