[ https://issues.apache.org/jira/browse/FLINK-27807?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Flink Jira Bot updated FLINK-27807: ----------------------------------- Labels: pull-request-available stale-minor (was: pull-request-available) I am the [Flink Jira Bot|https://github.com/apache/flink-jira-bot/] and I help the community manage its development. I see this issues has been marked as Minor but is unassigned and neither itself nor its Sub-Tasks have been updated for 180 days. I have gone ahead and marked it "stale-minor". If this ticket is still Minor, please either assign yourself or give an update. Afterwards, please remove the label or in 7 days the issue will be deprioritized. > The improvement of addBatch is empty when jdbc batch submit > ----------------------------------------------------------- > > Key: FLINK-27807 > URL: https://issues.apache.org/jira/browse/FLINK-27807 > Project: Flink > Issue Type: Improvement > Components: Connectors / JDBC > Affects Versions: 1.14.4, 1.15.0 > Reporter: shmily > Priority: Minor > Labels: pull-request-available, stale-minor > > Extending the DM database dialect through JDBC, when executing Upsert > semantics, a "parameter not bound" exception will be thrown, and it is found > that the following code can be improved: > {code:java} > for (Map.Entry<RowData, Tuple2<Boolean, RowData>> entry : > reduceBuffer.entrySet()) { > if (entry.getValue().f0) { > upsertExecutor.addToBatch(entry.getValue().f1); > } else { > // delete by key > deleteExecutor.addToBatch(entry.getKey()); > } > } > upsertExecutor.executeBatch(); > deleteExecutor.executeBatch(); > reduceBuffer.clear();{code} > That is to say, when the size of reduceBuffer is 1, only one of the if-else > statement blocks is executed, which will cause > {code:java} > upsertExecutor().executeBatch() {code} > or > {code:java} > deleteExecutor.executeBatch(){code} > to have an empty batch executed, however, this will cause some jdbc driver > implementations to throw exceptions, as described above -- This message was sent by Atlassian Jira (v8.20.10#820010)