Hisoka-X commented on code in PR #9665:
URL: https://github.com/apache/seatunnel/pull/9665#discussion_r2257127624


##########
seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/sink/PaimonSinkWriter.java:
##########
@@ -199,23 +201,32 @@ public PaimonSinkWriter(
             return;
         }
         this.commitUser = states.get(0).getCommitUser();
-        long checkpointId = states.get(0).getCheckpointId();
         try (TableCommit tableCommit = tableWriteBuilder.newCommit()) {
-            List<CommitMessage> commitables =
+            Map<Long, List<CommitMessage>> commitMessagesMap =
                     states.stream()
-                            .map(PaimonSinkState::getCommittables)
-                            .flatMap(List::stream)
-                            .collect(Collectors.toList());
+                            .collect(
+                                    Collectors.toMap(
+                                            PaimonSinkState::getCheckpointId,
+                                            PaimonSinkState::getCommittables));
             // batch mode without checkpoint has no state to commit
-            if (commitables.isEmpty()) {
+            if (commitMessagesMap.isEmpty()) {
                 return;
             }
             // streaming mode or batch mode with checkpoint need to recommit 
by stream api
-            log.info("Trying to recommit states {}", commitables);
-            ((StreamTableCommit) tableCommit).commit(checkpointId, 
commitables);
+            log.info("Trying to recommit states {}", commitMessagesMap);
+            ((StreamTableCommit) 
tableCommit).filterAndCommit(commitMessagesMap);
         } catch (Exception e) {
-            throw new PaimonConnectorException(
-                    PaimonConnectorErrorCode.TABLE_WRITE_COMMIT_FAILED, e);
+            if (!(e.getCause() instanceof IllegalStateException)) {

Review Comment:
   we should check why paimon will throw `IllegalStateException`.



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