From 5d3cc41cc52716f6ddfe3ecf452c2fb05435e040 Mon Sep 17 00:00:00 2001 From: Askhat Nuriddinov Date: Fri, 21 Jun 2024 23:05:36 +0300 Subject: [PATCH] Use getResultRows to check KeeperMap entry existance --- CHANGELOG.md | 2 ++ build.gradle.kts | 2 +- .../kafka/connect/sink/state/provider/KeeperStateProvider.java | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9767e24..aec12fc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ * Bugfix to address string encoding issue * Bugfix to address issue with nested types and flatten_nested setting conflict * Bugfix to avoid storing keeper state in same column name if virtual topic is enabled +* Updated java-client to 0.6.1 +* Bugfix to let create missing KeeperMap entries if there are some records present already ## 1.1.0 * Updated java-client to 0.6.0-patch4 diff --git a/build.gradle.kts b/build.gradle.kts index e670e5f1..ba7e238f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -51,7 +51,7 @@ repositories { extra.apply { - set("clickHouseDriverVersion", "0.6.0-patch4") + set("clickHouseDriverVersion", "0.6.1") set("kafkaVersion", "2.7.0") set("avroVersion", "1.9.2") diff --git a/src/main/java/com/clickhouse/kafka/connect/sink/state/provider/KeeperStateProvider.java b/src/main/java/com/clickhouse/kafka/connect/sink/state/provider/KeeperStateProvider.java index 416d2a14..ce3210d5 100644 --- a/src/main/java/com/clickhouse/kafka/connect/sink/state/provider/KeeperStateProvider.java +++ b/src/main/java/com/clickhouse/kafka/connect/sink/state/provider/KeeperStateProvider.java @@ -85,7 +85,7 @@ public StateRecord getStateRecord(String topic, int partition) { .query(selectStr) .executeAndWait()) { LOGGER.debug("return size: {}", response.getSummary().getReadRows()); - if ( response.getSummary().getReadRows() == 0) { + if ( response.getSummary().getResultRows() == 0) { LOGGER.info(String.format("read state record: topic %s partition %s with NONE state", topic, partition)); return new StateRecord(topic, partition, 0, 0, State.NONE); }