Skip to content

Commit

Permalink
[Bugfix][Clickhouse] Fix clickhouse sink flush bug (#5448)
Browse files Browse the repository at this point in the history
* [Bug][connector-cdc-mysql] mysql connections and memory of jvm increased abnormally (#5008)

* [bugfix][connector-cdc-mysql] reset the listener of binaryLogClient before fetch task start (#5008)

* [Bugfix][Clickhouse] fix when the checkpoint triggers flush, the connection is closed, causing subsequent data writing to fail

---------

Co-authored-by: dengjunjie <296442618@qq.com>
  • Loading branch information
happyboy1024 and dengjunjie authored Sep 12, 2023
1 parent 38b6d6e commit cef03f6
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,14 @@ public void write(SeaTunnelRow element) throws IOException {

@Override
public Optional<CKCommitInfo> prepareCommit() throws IOException {
flush();
for (ClickhouseBatchStatement batchStatement : statementMap.values()) {
JdbcBatchStatementExecutor statement = batchStatement.getJdbcBatchStatementExecutor();
IntHolder intHolder = batchStatement.getIntHolder();
if (intHolder.getValue() > 0) {
flush(statement);
intHolder.setValue(0);
}
}
return Optional.empty();
}

Expand Down

0 comments on commit cef03f6

Please sign in to comment.