[ 
https://issues.apache.org/jira/browse/BEAM-8100?focusedWorklogId=316844&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-316844
 ]

ASF GitHub Bot logged work on BEAM-8100:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Sep/19 17:19
            Start Date: 23/Sep/19 17:19
    Worklog Time Spent: 10m 
      Work Description: jklukas commented on pull request #9499: [BEAM-8100] 
Exception handling for AsJsons and ParseJsons
URL: https://github.com/apache/beam/pull/9499#discussion_r327232852
 
 

 ##########
 File path: 
sdks/java/extensions/jackson/src/main/java/org/apache/beam/sdk/extensions/jackson/ParseJsons.java
 ##########
 @@ -73,4 +139,66 @@ public OutputT apply(String input) {
               }
             }));
   }
+
+  /** A {@code PTransform} that adds exception handling to {@link ParseJsons}. 
*/
+  public class ParseJsonsWithFailures<FailureT>
+      extends PTransform<PCollection<String>, 
WithFailures.Result<PCollection<OutputT>, FailureT>> {
+    @Nullable
+    private InferableFunction<WithFailures.ExceptionElement<String>, FailureT> 
exceptionHandler;
+
+    @Nullable private final transient TypeDescriptor<FailureT> failureType;
+
+    ParseJsonsWithFailures(
+        InferableFunction<WithFailures.ExceptionElement<String>, FailureT> 
exceptionHandler,
+        TypeDescriptor<FailureT> failureType) {
+      this.exceptionHandler = exceptionHandler;
+      this.failureType = failureType;
+    }
+
+    public ParseJsonsWithFailures<FailureT> exceptionsVia(
 
 Review comment:
   Javadoc needed.
 
----------------------------------------------------------------
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 316844)
    Time Spent: 3h 10m  (was: 3h)

> Add exception handling to Json transforms in Java SDK
> -----------------------------------------------------
>
>                 Key: BEAM-8100
>                 URL: https://issues.apache.org/jira/browse/BEAM-8100
>             Project: Beam
>          Issue Type: Improvement
>          Components: extensions-java-json, sdk-java-core
>            Reporter: Jeff Klukas
>            Assignee: Alexey Romanenko
>            Priority: Minor
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> Follow-up to https://issues.apache.org/jira/browse/BEAM-5638. We have 
> exception handling for MapElements and FlatMapElements. It should be 
> straightforward to add parallel signatures to AsJsons and ParseJsons for 
> catching parsing errors.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to