zhuanshenbsj1 commented on code in PR #10809:
URL: https://github.com/apache/hudi/pull/10809#discussion_r1557816512


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -576,12 +576,17 @@ private void doCommit(String instant, List<WriteStatus> 
writeResults) {
       }
     } else {
       LOG.error("Error when writing. Errors/Total=" + totalErrorRecords + "/" 
+ totalRecords);
-      LOG.error("The first 100 error messages");
-      
writeResults.stream().filter(WriteStatus::hasErrors).limit(100).forEach(ws -> {
-        LOG.error("Global error for partition path {} and fileID {}: {}",
-            ws.getGlobalError(), ws.getPartitionPath(), ws.getFileId());
+      LOG.error("The first 10 files with write errors:");
+      
writeResults.stream().filter(WriteStatus::hasErrors).limit(10).forEach(ws -> {
+        if (ws.getGlobalError() != null) {
+          LOG.error("Global error for partition path {} and fileID {}: {}",
+              ws.getPartitionPath(), ws.getFileId(), ws.getGlobalError());
+        }
         if (ws.getErrors().size() > 0) {
-          ws.getErrors().forEach((key, value) -> LOG.trace("Error for key:" + 
key + " and value " + value));
+          LOG.error("The first 100 records-level errors for partition path {} 
and fileID {}:",
+              ws.getPartitionPath(), ws.getFileId());
+          ws.getErrors().entrySet().stream().limit(100).forEach(entry -> 
LOG.error("Error for key: "

Review Comment:
   
![image](https://github.com/apache/hudi/assets/34104400/fdc88c52-5279-4a09-ab3c-e543499e8289)
   Test is ok~



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to