chunjun icon indicating copy to clipboard operation
chunjun copied to clipboard

[Bug] [chunjun-connector-jdbc-base] clickhouse jdbc connection not supported setAutoCommit(false)

Open fengjian1129 opened this issue 1 year ago • 1 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

What happened

When I tried to implement the synchronization function of clickhouse2hive, I found the following error message. Caused by: java.sql.SQLFeatureNotSupportedException: Transactions are not supported at ru.yandex.clickhouse.ClickHouseConnectionImpl.setAutoCommit(ClickHouseConnectionImpl.java:219) at com.dtstack.flinkx.connector.jdbc.source.JdbcInputFormat.openInternal(JdbcInputFormat.java:114)

I think the problem lies in this piece of code image

What you expected to happen

I hope to control clickhouse-source to skip opening transactions by configuring parameters,for example: image Because the default value is "semantic": "at-least-once"`, it does not affect other synchronization functions

How to reproduce

When using clickhouse-source to read data, this type of problem may occur

Anything else

null

Version

master

Are you willing to submit PR?

  • [X] Yes I am willing to submit a PR!

Code of Conduct

fengjian1129 avatar Aug 12 '24 07:08 fengjian1129

I think this can unify the management of whether transactions are enabled or not, without the need to change setAutoCommit for every chunjun-connector-module

fengjian1129 avatar Aug 12 '24 07:08 fengjian1129

Try it with the latest version. clickhouse has overwrite openInternal and removed setAutoCommit

yanghuaiGit avatar Nov 05 '25 01:11 yanghuaiGit