Yizhou-Yang commented on code in PR #7418:
URL: https://github.com/apache/inlong/pull/7418#discussion_r1116484165


##########
inlong-sort/sort-connectors/iceberg/src/main/java/org/apache/inlong/sort/iceberg/sink/multiple/IcebergMultipleStreamWriter.java:
##########
@@ -201,7 +238,41 @@ public void processElement(RecordWithSchema 
recordWithSchema) throws Exception {
 
         if (multipleWriters.get(tableId) != null) {
             for (RowData data : recordWithSchema.getData()) {
-                multipleWriters.get(tableId).processElement(data);
+                try {
+                    multipleWriters.get(tableId).processElement(data);
+                } catch (Exception e) {
+                    LOG.error(String.format("write error, raw data: %s", 
data), e);
+                    if (!dirtyOptions.ignoreDirty()) {
+                        throw e;
+                    }
+                    if (dirtySink != null) {
+                        DirtyData.Builder<Object> builder = 
DirtyData.builder();
+                        try {
+                            builder.setData(data)
+                                    .setLabels(dirtyOptions.getLabels())
+                                    .setLogTag(dirtyOptions.getLogTag())
+                                    
.setIdentifier(dirtyOptions.getIdentifier())

Review Comment:
   parse the data by using DirtySinkhelper.replace(), and then 
jsondynamicschema.parse()



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