🐛 Destination snowflake v2: one more database name uppercase fix - #29949
Conversation
Before Merging a Connector Pull RequestWow! 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:
If the checklist is complete, but the CI check is failing,
|
|
| 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 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
Evan Tahler (evantahler)
left a comment
There was a problem hiding this comment.
👍... we should one day have tests for this I guess
| AND table_name = ? | ||
| """, | ||
| databaseName, | ||
| databaseName.toUpperCase(), |
There was a problem hiding this comment.
Will this break v2 stuff? Since we're not always using uppercase? Or is the DB always uppercase regardless? Would an ilike() be safer?
There was a problem hiding this comment.
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.)
|
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 |
seen in https://github.com/airbytehq/oncall/issues/2835