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

Create temporary views with 'or replace' #902

Closed
wants to merge 1 commit into from

Conversation

annazizian
Copy link
Contributor

resolves #350

Problem

A re-run of an incremental model tries to create the temporary view <model_name>__dbt_tmp within the same session and fails. This happens when the view is not dropped in the previous run.

Solution

Just replace the view if it already exists. As the view is intended to be used within the run only, replacing the view on re-run won't affect anything and will solve the issue.

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
  • This PR includes tests, or tests are not required/relevant for this PR
  • 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

@annazizian annazizian requested a review from a team as a code owner October 6, 2023 09:25
@annazizian annazizian requested a review from VersusFacit October 6, 2023 09:25
@cla-bot cla-bot bot added the cla:yes label Oct 6, 2023
@colin-rogers-dbt
Copy link
Contributor

closing as this was resolved in #906

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.

[CT-622] TempTableAlreadyExistsException: Temporary view already exists
2 participants