gong commented on code in PR #7418:
URL: https://github.com/apache/inlong/pull/7418#discussion_r1115427997
##########
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())
+ .setRowType(
multipleWriters.get(tableId).getFlinkRowType())
+ .setDirtyMessage(e.getMessage());
+ dirtySink.invoke(builder.build());
+ if (sinkMetricData != null) {
+ sinkMetricData.invokeDirtyWithEstimate(data);
+ }
Review Comment:
here should use table level dirty data method
--
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]