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

Fix capitalization issue #742

Merged
merged 3 commits into from
Jul 24, 2024
Merged

Fix capitalization issue #742

merged 3 commits into from
Jul 24, 2024

Conversation

benc-db
Copy link
Collaborator

@benc-db benc-db commented Jul 24, 2024

Description

Incremental tables were potentially not running incrementally if components were specified with capitalization, as in information_schema they are always present in lowercase. Talking to dbt to see if there is a better way to do this, but for now, ensure lower case when used in queries.

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.

table_schema = lower('{{ relation.schema }}')
and table_name = lower('{{ relation.identifier }}')
table_schema = '{{ relation.schema|lower }}'
and table_name = '{{ relation.identifier|lower }}'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if the table name is configured as case-sensitive

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you link to ref? This would be a considerable monkey wrench if so.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm. Just found Databricks table name is always case insenstive.

jackyhu-db
jackyhu-db previously approved these changes Jul 24, 2024
@benc-db
Copy link
Collaborator Author

benc-db commented Jul 24, 2024

Going to merge (after changelog) and if dbt has a better option, will do that as a separate PR.

@benc-db benc-db merged commit fdb130e into main Jul 24, 2024
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.

2 participants