zhilinli123 commented on code in PR #4328:
URL: 
https://github.com/apache/incubator-seatunnel/pull/4328#discussion_r1136493648


##########
seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/client/ClickhouseSinkWriter.java:
##########
@@ -75,16 +87,17 @@ public void write(SeaTunnelRow element) throws IOException {
                             
.indexOf(this.option.getShardMetadata().getShardKey());
             shardKey = element.getField(i);
         }
-        ClickhouseBatchStatement statement = 
statementMap.get(shardRouter.getShard(shardKey));
-        JdbcBatchStatementExecutor clickHouseStatement = 
statement.getJdbcBatchStatementExecutor();
-        IntHolder sizeHolder = statement.getIntHolder();
+        this.statement = statementMap.get(shardRouter.getShard(shardKey));
+        this.clickHouseStatement = statement.getJdbcBatchStatementExecutor();
+        this.sizeHolder = statement.getIntHolder();
         // add into batch
-        addIntoBatch(element, clickHouseStatement);
-        sizeHolder.setValue(sizeHolder.getValue() + 1);
+        addIntoBatch(element, this.clickHouseStatement);
+        this.sizeHolder.setValue(this.sizeHolder.getValue() + 1);
+        tryOpen();

Review Comment:
   This is a historical commentary Please check the latest



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to