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

Drop temp table if exists #1397

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

joshuao11
Copy link

@joshuao11 joshuao11 commented Nov 8, 2024

The insert overwrite does this, so let's copy that pattern here to keep the schemas/datasets tidy in BQ for the users

resolves ##1389

Problem

When using a merge strategy with the model checking the schema (To add or replace columns):
image

There is nothing to delete the temp table created:

image

Solution

We add in a step to delete and tidy up the temporary table, in the same way that is currently there for the insert_overwrite strategy:

image

I also checked that there was no impact on the 'ignore' strategy for on_schema_change:

There is no temporary table made here so we do not expect the DROP statement to appear:

image

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
    I ran tox -p and everything seems to pass
  • This PR includes tests, or tests are not required/relevant for this PR

This change does change a macro but i'm unsure how to get feedback for Product or DX

  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

The insert overwrite does this, so let's copy that pattern here to keep the schemas/datasets tidy in BQ for the users
@joshuao11 joshuao11 requested a review from a team as a code owner November 8, 2024 15:18
Copy link

cla-bot bot commented Nov 8, 2024

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR.

CLA has not been signed by users: @joshuao11

@cla-bot cla-bot bot added the cla:yes label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant