aloyszhang commented on code in PR #9792:
URL: https://github.com/apache/inlong/pull/9792#discussion_r1517221328
##########
inlong-sort/sort-formats/format-rowdata/format-rowdata-json/src/main/java/org/apache/inlong/sort/formats/json/JsonRowDataDeserializationSchema.java:
##########
@@ -104,13 +103,20 @@ public static Builder builder(RowType rowType,
TypeInformation<RowData> resultTy
}
@Override
- public RowData deserializeInternal(@Nullable byte[] message) throws
IOException {
+ public RowData deserializeInternal(@Nullable byte[] message) throws
Exception {
if (message == null) {
return null;
}
String jsonStr = new String(message, charset);
- return (RowData) runtimeConverter.convert(jsonStr);
+ RowData rowData = null;
+ try {
+ rowData = (RowData) runtimeConverter.convert(jsonStr);
+ } catch (Throwable t) {
+ failureHandler.onParsingMsgFailure(message, new RuntimeException(
Review Comment:
For readability, `jsonStr` is better than `message`
--
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]