Skip to content

🐛 Destination snowflake v2: one more database name uppercase fix - #29949

Merged
Edward Gao (edgao) merged 2 commits into
masterfrom
edgao/snowflake/dv2/more_dbname_uppercase
Aug 29, 2023
Merged

🐛 Destination snowflake v2: one more database name uppercase fix#29949
Edward Gao (edgao) merged 2 commits into
masterfrom
edgao/snowflake/dv2/more_dbname_uppercase

Conversation

@edgao

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Aug 29, 2023

Copy link
Copy Markdown
Contributor

Before Merging a Connector Pull Request

Wow! What a great pull request you have here! 🎉

To merge this PR, ensure the following has been done/considered for each connector added or updated:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan.
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • You've updated the connector's metadata.yaml file any other relevant changes, including a breakingChanges entry for major version bumps. See metadata.yaml docs
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • Migration guide updated in docs/integrations/<source or destination>/<name>-migrations.md with an entry for the new version, if the version is a breaking change. See migration guide example
  • If set, you've ensured the icon is present in the platform-internal repo. (Docs)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.

@edgao Edward Gao (edgao) changed the title Destination snowflake v2: one more database name uppercase fix 🐛 Destination snowflake v2: one more database name uppercase fix Aug 29, 2023
@octavia-squidington-iii Octavia Squidington III (octavia-squidington-iii) added the area/documentation Improvements or additions to documentation label Aug 29, 2023
@edgao
Edward Gao (edgao) marked this pull request as ready for review August 29, 2023 14:33
@edgao
Edward Gao (edgao) requested a review from a team as a code owner August 29, 2023 14:33
@github-actions

Copy link
Copy Markdown
Contributor

destination-snowflake test report (commit cdbccc54bc) - ✅

⏲️ Total pipeline duration: 34mn53s

Step Result
Java Connector Unit Tests
Build connector tar
Build destination-snowflake docker image for platform linux/x86_64
Build airbyte/normalization-snowflake:dev
Java Connector Integration Tests
Validate airbyte-integrations/connectors/destination-snowflake/metadata.yaml
Connector version semver check
Connector version increment check
QA checks

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=destination-snowflake test

@evantahler Evan Tahler (evantahler) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍... we should one day have tests for this I guess

AND table_name = ?
""",
databaseName,
databaseName.toUpperCase(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Will this break v2 stuff? Since we're not always using uppercase? Or is the DB always uppercase regardless? Would an ilike() be safer?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

tl;dr I think toUpperCase is correct

I ran create database "edgao_MIXED_CASE_test_db"; to create a database with mixed-case name, granted ownership to AIRBYTE_ROLE, then put that value into the config. check actually failed (I’d assumed we would fail at sync time) on non-v2-related code.

Then I ran create database edgao_MIXED_CASE_test_db; (i.e. no quotes, so implicitly uppercased) + granted ownership. check succeeded in this case.

so I'm concluding that destination-snowflake is implicitly upcasing the database name everywhere.

(technical notes: I also had to create schema edgao_mised_case_test_db.edgao_test, and there was some annoying role-switching between sysadmin and airbyte_role to get all the permissions right. But none of that has bearing on the name-upcasing behavior.)

@edgao
Edward Gao (edgao) merged commit 7a8ab18 into master Aug 29, 2023
@edgao
Edward Gao (edgao) deleted the edgao/snowflake/dv2/more_dbname_uppercase branch August 29, 2023 17:55
@edgao

Copy link
Copy Markdown
Contributor Author

and yes, we should have tests for this. I'll do that later today, I think we maybe want to add a CI secret to exercise it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/destination/snowflake

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants