zhilinli123 commented on code in PR #4328:
URL:
https://github.com/apache/incubator-seatunnel/pull/4328#discussion_r1133471205
##########
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:
****
> > Should it be? `statement =
statementMap.get(shardRouter.getShard(shardKey));
> > clickHouseStatement = statement.getJdbcBatchStatementExecutor();
> > sizeHolder = statement.getIntHolder(); `
>
> No, just do not use `ClickhouseSinkWriter` object's fields to save
`statement` and `sizeHolder`. Because it belong shard, not writer. One writer
may have many shard.
Can you do some hints on code?
--
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]