Yizhou-Yang commented on code in PR #7148:
URL: https://github.com/apache/inlong/pull/7148#discussion_r1092680812
##########
inlong-sort/sort-connectors/doris/src/main/java/org/apache/inlong/sort/doris/table/DorisDynamicSchemaOutputFormat.java:
##########
@@ -512,27 +524,58 @@ private void handleDirtyData(Object dirtyData, DirtyType
dirtyType, Exception e)
LOG.warn("Dirty sink failed", ex);
}
}
+
metricData.invokeDirty(1,
dirtyData.toString().getBytes(StandardCharsets.UTF_8).length);
}
private void handleMultipleDirtyData(Object dirtyData, DirtyType
dirtyType, Exception e) {
- JsonNode rootNode;
+ JsonNode rootNode = null;
+ String database = null;
+ String table = null;
try {
- rootNode = jsonDynamicSchemaFormat.deserialize(((RowData)
dirtyData).getBinary(0));
+ if (dirtyData instanceof RowData) {
+ rootNode = jsonDynamicSchemaFormat.deserialize(((RowData)
dirtyData).getBinary(0));
+ } else if (dirtyData instanceof JsonNode) {
+ rootNode = (JsonNode) dirtyData;
+ } else if (dirtyData instanceof String) {
+ // parse and remove the added identifier for string cases
+ String[] arr = ((String) dirtyData).split("\\.");
Review Comment:
for rowdata in multiple sink, the dirty sink needs to know the identifier.
So I passed in "identifier + DIRTY_SEPARATOR + rowData" to be parsed for those
that misses the identifier. The multiple sink scenario all lacks the
identifier, so this identifier is added for every single call of string to this
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]