Hisoka-X commented on code in PR #4328:
URL:
https://github.com/apache/incubator-seatunnel/pull/4328#discussion_r1136478422
##########
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:
I mean one writer may have many `sizeHolder`, `clickHouseStatement` and
`statement`. Because one writer have many shard, one shard have one
`sizeHolder`, `clickHouseStatement` and `statement`. So the `this.sizeHolder`
will change when last row had change ( the row change then the last shard also
change).
--
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]