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

Persist docs on incremental only if changed #513

Merged
merged 6 commits into from
Nov 27, 2023
Merged

Conversation

benc-db
Copy link
Collaborator

@benc-db benc-db commented Nov 21, 2023

Doesn't fully resolve persist_docs perf issues, but should help for the case of incremental tables. Resolves #514 for incremental and regular tables.

Description

For incremental tables, only run alter column if the description has changed. This incurs an additional describe extended (because we don't have a cache for this information), but since alter column purportedly takes 6 seconds per command, this should be a net benefit to all but the thinnest of incremental tables.

Checklist

  • 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
  • I have updated the CHANGELOG.md and added information about my change to the "dbt-databricks next" section.

andrefurlan-db
andrefurlan-db previously approved these changes Nov 21, 2023
@benc-db
Copy link
Collaborator Author

benc-db commented Nov 22, 2023

Expanded to be general. Since this macro will always be called after we have created the table, we can always compare with the existing table's columns to see what we need to alter. This allows us to avoid the call on columns that are missing descriptions on a fresh table create, and only alter columns that have changed on later calls to incremental.

andrefurlan-db
andrefurlan-db previously approved these changes Nov 22, 2023
@benc-db benc-db merged commit 675405a into main Nov 27, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Persist Docs fails when a column is defined that does not exist
2 participants