snowflake-kafka-connector
snowflake-kafka-connector copied to clipboard
Column name as sql keyword
Hello,
My kafka message contains field trigger
. When I run connector to read those messages I got error
2023-08-01 07:25:50,132 WARN [snowflake-connector|task-1] Failure altering table to add column: <topic_name>, this could happen when multiple partitions try to alter the table at the same time and the warning could be ignored (com.snowflake.kafka.connector.internal.streaming.SchematizationUtils) [task-thread-snowflake-connector-1]
snowflake-connect-connect-5b4c4778c9-rc9h7 snowflake-connect-connect com.snowflake.kafka.connector.internal.SnowflakeKafkaConnectorException: [SF_KAFKA_CONNECTOR] Exception: Failed to append columns
snowflake-connect-connect-5b4c4778c9-rc9h7 snowflake-connect-connect Error Code: 2015
snowflake-connect-connect-5b4c4778c9-rc9h7 snowflake-connect-connect Detail: Failed to append columns during schema evolution
snowflake-connect-connect-5b4c4778c9-rc9h7 snowflake-connect-connect Message: SQL compilation error:
snowflake-connect-connect-5b4c4778c9-rc9h7 snowflake-connect-connect syntax error line 1 at position 621 unexpected 'trigger'.
snowflake-connect-connect-5b4c4778c9-rc9h7 snowflake-connect-connect net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowExceptionSub(SnowflakeUtil.java:129)
snowflake-connect-connect-5b4c4778c9-rc9h7 snowflake-connect-connect net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowException(SnowflakeUtil.java:70)
snowflake-connect-connect-5b4c4778c9-rc9h7 snowflake-connect-connect net.snowflake.client.core.StmtUtil.pollForOutput(StmtUtil.java:456)
Is there any solution to this?
We have a backlog item on this and will add support in the coming releases. Do note that schema detection and evolution support for kafka connector is in a public preview state.
The right way to handle this right is to double quote the column name when schema evolution tries to add the column.
https://docs.snowflake.com/en/sql-reference/reserved-keywords
Thanks for reply! Do you have any estimation when it will be live?
Not really, we will keep you updated. As a workaround, you can create a table with the trigger column first.
This should be fixed with this PR: https://github.com/snowflakedb/snowflake-kafka-connector/pull/693
We will release 2.0.2 in the next few weeks
Thanks for update! Next few weeks is more like 1-2 weeks or 5-6? I'm asking because it's blocking us a bit
We are planning to stick to once a month release cadence for client side releases. so end of this month is the right expectation IMO.