airbytehq / airbyte

The leading data integration platform for ETL / ELT data pipelines from APIs, databases & files to data warehouses, data lakes & data lakehouses. Both self-hosted and Cloud-hosted.
https://airbyte.com
Other
16.29k stars 4.15k forks source link

[destination-snowflake] UTF-8 Table Name Corruption with Japanese Characters #47365

Open myu65 opened 1 month ago

myu65 commented 1 month ago

Connector Name

destination-snowflake

Connector Version

3.15.0

What step the error happened?

During the sync

Relevant information

When using destination-snowflake version 3.15.0, if a Snowflake table name contains Japanese (UTF-8) characters, the table name is corrupted and appears as "AIRBYTE_RAW____". This issue did not occur in version 3.11.12.

Error Message:Warning from destination: net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error: Table "DB_NAME.SCHEMA_NAME._AIRBYTE_RAW____" does not exist or not authorized.

Steps to Reproduce:

  1. Use destination-snowflake version 3.15.0.
  2. Include Japanese (UTF-8) characters in a Snowflake table name.
  3. Execute data synchronization.
  4. Observe the error message mentioned above.

Expected Behavior: The table name should correctly appear as "AIRBYTE_RAW_テーブル名" (where テーブル名 means table name).

after
2024-10-25 01:46:54 destination > INFO sync-operations-1 i.a.i.b.d.t.BaseDestinationV1V2Migrator(shouldMigrate):43 Checking whether v1 raw table _airbyte_raw____ in dataset TIDB_inventory_fact_staging exists

the sql in snowflake is

DESCRIBE TABLE "SCHEMA_NAME"."_AIRBYTE_RAW________" 

and expected sql is

DESCRIBE TABLE "SCHEMA_NAME"."_AIRBYTE_RAW_テーブル名" 

Relevant log output

2024-10-25 01:46:54 destination > INFO sync-operations-1 i.a.i.b.d.t.TyperDeduperUtil(runMigrationsAsync$lambda$12):165 Maybe executing SnowflakeDV2Migration migration for stream SCHEMA_NAME.テーブル名. 2024-10-25 01:46:54 destination > INFO sync-operations-1 i.a.i.d.s.m.SnowflakeDV2Migration(migrateIfNecessary):32 Initializing DV2 Migration check 2024-10-25 01:46:54 destination > INFO sync-operations-1 i.a.i.b.d.t.BaseDestinationV1V2Migrator(migrateIfNecessary):19 Assessing whether migration is necessary for stream テーブル名 2024-10-25 01:46:54 destination > INFO sync-operations-1 i.a.i.b.d.t.BaseDestinationV1V2Migrator(shouldMigrate):43 Checking whether v1 raw table _airbyte_raw____ in dataset TIDB_inventory_fact_staging exists 2024-10-25 01:46:54 destination > INFO sync-operations-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2024-10-25 01:46:54 destination > INFO sync-operations-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2024-10-25 01:46:55 destination > WARN sync-operations-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery):138 closing connection because of an Exception net.snowflake.client.jdbc.SnowflakeSQLException: SQLコンパイルエラー: Table 「DB_NAME.SCHEMA_NAME._AIRBYTE_RAW____」は存在しないか、許可されていません。 at net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowExceptionSub(SnowflakeUtil.java:172) ~[snowflake-jdbc-3.19.0.jar:3.19.0] at net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowException(SnowflakeUtil.java:105) ~[snowflake-jdbc-3.19.0.jar:3.19.0] at net.snowflake.client.core.StmtUtil.pollForOutput(StmtUtil.java:490) ~[snowflake-jdbc-3.19.0.jar:3.19.0] at net.snowflake.client.core.StmtUtil.execute(StmtUtil.java:396) ~[snowflake-jdbc-3.19.0.jar:3.19.0] at net.snowflake.client.core.SFStatement.executeHelper(SFStatement.java:498) ~[snowflake-jdbc-3.19.0.jar:3.19.0] at net.snowflake.client.core.SFStatement.executeQueryInternal(SFStatement.java:215) ~[snowflake-jdbc-3.19.0.jar:3.19.0] at net.snowflake.client.core.SFStatement.executeQuery(SFStatement.java:149) ~[snowflake-jdbc-3.19.0.jar:3.19.0] at net.snowflake.client.core.SFStatement.execute(SFStatement.java:785) ~[snowflake-jdbc-3.19.0.jar:3.19.0] at net.snowflake.client.core.SFStatement.execute(SFStatement.java:693) ~[snowflake-jdbc-3.19.0.jar:3.19.0] at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQueryInternal(SnowflakeStatementV1.java:296) ~[snowflake-jdbc-3.19.0.jar:3.19.0] at net.snowflake.client.jdbc.SnowflakePreparedStatementV1.executeQuery(SnowflakePreparedStatementV1.java:158) ~[snowflake-jdbc-3.19.0.jar:3.19.0]

Contribute

marcosmarxm commented 1 week ago

I've added the issue to the connector backlog, but it won't be prioritized for now. If this issue is affecting you, please comment or give it a 👍. This helps the team understand the number of users facing the same problem so that high-impact issues can be prioritized.