Skip to content

Commit

Permalink
Merge pull request #13 from AlexanderMann/performance/remove-command-…
Browse files Browse the repository at this point in the history
…is-redundant

Performance: REMOVEing from an internal table stage before a DROP TABLE command is redundant
  • Loading branch information
AlexanderMann authored Aug 29, 2019
2 parents 1fb4615 + 46266b3 commit 77ca100
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions target_snowflake/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,14 +413,14 @@ def perform_update(self, cur, target_table_name, temp_table_name, key_properties
insert_columns=insert_columns,
dedupped_columns=dedupped_columns))

# Clear out the associated stage for the table
cur.execute('''
REMOVE @{db}.{schema}.%{temp_table}
'''.format(
db=sql.identifier(self.connection.configured_database),
schema=sql.identifier(self.connection.configured_schema),
temp_table=sql.identifier(temp_table_name)
))
if not self.s3:
# Clear out the associated stage for the table
cur.execute('''
REMOVE @{db}.{schema}.%{temp_table}
'''.format(
db=sql.identifier(self.connection.configured_database),
schema=sql.identifier(self.connection.configured_schema),
temp_table=sql.identifier(temp_table_name)))

# Drop the tmp table
cur.execute('''
Expand Down

0 comments on commit 77ca100

Please sign in to comment.