Skip to content

Commit

Permalink
fix destination state table collation for snowflake
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-airbyte committed Sep 18, 2024
1 parent e931c2a commit 1d9d5c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ data:
connectorSubtype: database
connectorType: destination
definitionId: 424892c4-daac-4491-b35d-c6688ba547ba
dockerImageTag: 3.11.12
dockerImageTag: 3.12.0
dockerRepository: airbyte/destination-snowflake
documentationUrl: https://docs.airbyte.com/integrations/destinations/snowflake
githubIssueLabel: destination-snowflake
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ class SnowflakeSqlGenerator(
}

override fun createSchema(schema: String): Sql {
return of("""CREATE SCHEMA IF NOT EXISTS "$schema";""")
return of(
"""CREATE SCHEMA IF NOT EXISTS "$schema"
|DEFAULT_DDL_COLLATION='utf8';""".trimMargin()
)
}

override fun createTable(stream: StreamConfig, suffix: String, force: Boolean): Sql {
Expand All @@ -99,7 +102,7 @@ class SnowflakeSqlGenerator(
val createTableSql =
"""
|CREATE $forceCreateTable TABLE ${stream.id.quotedFinalTableId(suffix)} (
| "_AIRBYTE_RAW_ID" TEXT NOT NULL,
| "_AIRBYTE_RAW_ID" TEXT NOT NULL COLLATE 'utf8',
| "_AIRBYTE_EXTRACTED_AT" TIMESTAMP_TZ NOT NULL,
| "_AIRBYTE_META" VARIANT NOT NULL,
| "_AIRBYTE_GENERATION_ID" INTEGER
Expand Down
5 changes: 3 additions & 2 deletions docs/integrations/destinations/snowflake.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,9 @@ desired namespace.

| Version | Date | Pull Request | Subject |
| :-------------- | :--------- | :--------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 3.11.12 | 2024-09-12 | [45370](https://github.com/airbytehq/airbyte/pull/45370) | fix a race condition in our orphanedThreadFilter |
| 3.11.11 | 2024-08-20 | [44476](https://github.com/airbytehq/airbyte/pull/44476) | Increase message parsing limit to 100mb |
| 3.12.0 | 2024-09-17 | [\#38585](https://github.com/airbytehq/airbyte/pull/38585) | force UTF8 collation when creating schemas and tables |
| 3.11.12 | 2024-09-12 | [\#45370](https://github.com/airbytehq/airbyte/pull/45370) | fix a race condition in our orphanedThreadFilter |
| 3.11.11 | 2024-08-20 | [\#44476](https://github.com/airbytehq/airbyte/pull/44476) | Increase message parsing limit to 100mb |
| 3.11.10 | 2024-08-22 | [\#44526](https://github.com/airbytehq/airbyte/pull/44526) | Revert protocol compliance fix |
| 3.11.9 | 2024-08-19 | [\#43367](https://github.com/airbytehq/airbyte/pull/43367) | Add opt in using MERGE statement for upserts and deletes |
| 3.11.8 | 2024-08-16 | [\#42505](https://github.com/airbytehq/airbyte/pull/42505) | Fix bug in refreshes logic (already mitigated in platform, just fixing protocol compliance) |
Expand Down

0 comments on commit 1d9d5c6

Please sign in to comment.