使用Kettle 整合不同Mysql数据库数据,批量插入Clickhouse,会不定时出现java.net.SocketException: Broken pipe
错误 。Clickhouse社区给出的答案是驱动问题。社区回答
这里使用的还是kettle 8.1的包,9.1也可以使用,这里使用Clickhouse官方最新驱动
<!-- https://mvnrepository.com/artifact/com.clickhouse/clickhouse-jdbc -->
<dependency>
<groupId>com.clickhouse</groupId>
<artifactId>clickhouse-jdbc</artifactId>
<version>0.3.2-patch3</version>
</dependency>
@DatabaseMetaPlugin(type = "Clickhouse", typeDescription = "Clickhouse")
public class ClickhouseDatabaseMeta extends BaseDatabaseMeta implements DatabaseInterface {
private static final String STRICT_BIGNUMBER_INTERPRETATION = "STRICT_NUMBER_38_INTERPRETATION";
将所有依赖jar,打包成jar包。存放到新建clickhouse-plugins文件夹下。需要去Maven仓库把相关jar,和驱动放在 libswt /win64/下 。