rezarokni commented on a change in pull request #11929:
URL: https://github.com/apache/beam/pull/11929#discussion_r437807053
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/JsonToRow.java
##########
@@ -116,4 +131,267 @@ private ObjectMapper objectMapper() {
return this.objectMapper;
}
}
+
+ /**
+ * Enable Dead letter support. If this value is set errors in the parsing
layer are returned as
+ * Row objects within a {@link ParseResult}
+ *
+ * <p>You can access the results by using:
+ *
+ * <p>ParseResult results =
jsonPersons.apply(JsonToRow.withDeadLetter(PERSON_SCHEMA));
+ *
+ * <p>{@link ParseResult#getResults()}
+ *
+ * <p>{@Code PCollection<Row> personRows = results.getResults()}
+ *
+ * <p>{@link ParseResult#getFailedToParseLines()}
+ *
+ * <p>{@Code PCollection<Row> errorsLines = results.getFailedToParseLines()}
+ *
+ * <p>To access the reason for the failure you will need to first enable
extended error reporting.
+ * {@Code ParseResult results =
+ *
jsonPersons.apply(JsonToRow.withDeadLetter(PERSON_SCHEMA).withExtendedErrorInfo());
}
+ *
+ * <p>{@link ParseResult#getFailedToParseLinesWithErr()}
+ *
+ * <p>{@Code PCollection<Row> errorsLinesWithErrMsg =
results.getFailedToParseLines()}
+ *
+ * @return {@link JsonToRowWithErrFn}
+ */
+ @Experimental(Kind.SCHEMAS)
+ public static JsonToRowWithErrFn withDeadLetter(Schema rowSchema) {
Review comment:
Changed to withExceptionReporting.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]