[
https://issues.apache.org/jira/browse/BEAM-12474?focusedWorklogId=620159&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-620159
]
ASF GitHub Bot logged work on BEAM-12474:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 07/Jul/21 18:58
Start Date: 07/Jul/21 18:58
Worklog Time Spent: 10m
Work Description: zhoufek commented on a change in pull request #15037:
URL: https://github.com/apache/beam/pull/15037#discussion_r665631991
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/WithFailures.java
##########
@@ -92,6 +93,24 @@
}
}
+ /**
+ * A handler that holds onto the {@link Throwable} that led to the
exception, returning it along
+ * with the original value as a {@link KV}.
+ *
+ * <p>Extends {@link SimpleFunction} so that full type information is
captured. {@link KV} and
+ * {@link ComparableThrowable} coders can be easily inferred by Beam, so
coder inference can be
+ * successfully applied if the consuming transform passes type information
to the failure
+ * collection's {@link TupleTag}. This may require creating an instance of
an anonymous inherited
+ * class rather than of this class directly.
+ */
+ public static class ThrowableHandler<T>
+ extends SimpleFunction<ExceptionElement<T>, KV<T, ComparableThrowable>> {
+ @Override
+ public KV<T, ComparableThrowable> apply(ExceptionElement<T> f) {
+ return KV.of(f.element(),
ComparableThrowable.forThrowable(f.exception()));
Review comment:
Yes, it's using `SerializableCoder`. Should there be a custom coder to
handle this, or should it be explicitly registered?
Sorry, I'm not that familiar with how pipeline updates can be affected by
changes like this.
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 620159)
Time Spent: 4h 20m (was: 4h 10m)
> Configure PubsubIO with dead-letter topic
> -----------------------------------------
>
> Key: BEAM-12474
> URL: https://issues.apache.org/jira/browse/BEAM-12474
> Project: Beam
> Issue Type: Improvement
> Components: io-java-gcp
> Reporter: Zachary Houfek
> Assignee: Zachary Houfek
> Priority: P2
> Time Spent: 4h 20m
> Remaining Estimate: 0h
>
> Based on discussion from [PR14971|https://github.com/apache/beam/pull/14971].
> Currently, PubsubIO throws a RuntimeException when it can't parse a payload.
> It would perhaps be helpful if users could configure PubsubIO.Read with a
> dead-letter topic so that parsing errors instead write to the topic rather
> than just throw an exception.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)