Hisoka-X commented on code in PR #4328:
URL: 
https://github.com/apache/incubator-seatunnel/pull/4328#discussion_r1133420674


##########
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();

Review Comment:
   Don't use `this` to save fields which mapping with shardKey, because one 
writer can hold many different shardKey, so it will have many 
`statement`,`sizeHolder`. Use `this` to save it may cause conflusion.



-- 
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