shmilygkd opened a new pull request, #19829:
URL: https://github.com/apache/flink/pull/19829

   ## What is the purpose of the change
   
   *The improvement of addBatch is empty when jdbc batch submit*
   
   
   ## Brief change log
   
   *Increase execution flags to ensure empty batches are not executed*
   
   
   ## Verifying this change
   
   ```
   @Override
       public void executeBatch() throws SQLException {
           boolean upsertExecuteBatchFlag = false;
           boolean deleteExecuteBatchFlag = false;
           for (Map.Entry<RowData, Tuple2<Boolean, RowData>> entry : 
reduceBuffer.entrySet()) {
               if (entry.getValue().f0) {
                   upsertExecutor.addToBatch(entry.getValue().f1);
                   upsertExecuteBatchFlag = true;
               } else {
                   // delete by key
                   deleteExecutor.addToBatch(entry.getKey());
                   deleteExecuteBatchFlag = true;
               }
           }
           if (upsertExecuteBatchFlag) {
               upsertExecutor.executeBatch();
           }
           if (deleteExecuteBatchFlag) {
               deleteExecutor.executeBatch();
           }
           reduceBuffer.clear();
       }
   ```
   
   ## Does this pull request potentially affect one of the following parts:
   
   
flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/internal/executor/TableBufferReducedStatementExecutor.java
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no)
     - If yes, how is the feature documented? (not documented)
   


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