[ 
https://issues.apache.org/jira/browse/FLINK-28345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17561700#comment-17561700
 ] 

Feng Jin commented on FLINK-28345:
----------------------------------

[~martijnvisser]  Thanks for the suggestion, I reported it to the clickhouse 
community, they will fix it in the next version 
[https://github.com/ClickHouse/clickhouse-jdbc/issues/977]  .  Maybe we can 
close this jira now. 

> Flink JDBC connector should check batch count before flush
> ----------------------------------------------------------
>
>                 Key: FLINK-28345
>                 URL: https://issues.apache.org/jira/browse/FLINK-28345
>             Project: Flink
>          Issue Type: Improvement
>          Components: Connectors / JDBC
>    Affects Versions: 1.15.0, 1.14.5
>            Reporter: Feng Jin
>            Priority: Major
>
> org.apache.flink.connector.jdbc.internal.JdbcOutputFormat#flush
> {code:java}
> //代码占位符
> @Override
> public synchronized void flush() throws IOException {
>     checkFlushException();
>     for (int i = 0; i <= executionOptions.getMaxRetries(); i++) {
>         try {
>             attemptFlush();
>             batchCount = 0;
>             break; 
>    ....{code}
> When flush the batch,  we should check batchCount  is grater than 0. Other 
> wise it would cause some problem with some drivers that do not support empty 
> batches, like clickhouse jdbc driver. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to