Polber commented on code in PR #29261:
URL: https://github.com/apache/beam/pull/29261#discussion_r1379610632


##########
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaReadSchemaTransformProvider.java:
##########
@@ -183,14 +188,17 @@ public PCollectionRowTuple expand(PCollectionRowTuple 
input) {
 
           PCollectionTuple outputTuple =
               kafkaValues.apply(
-                  ParDo.of(new ErrorFn("Kafka-read-error-counter", 
valueMapper))
+                  ParDo.of(new ErrorFn("Kafka-read-error-counter", 
valueMapper, failOnError))
                       .withOutputTags(OUTPUT_TAG, TupleTagList.of(ERROR_TAG)));
 
-          return PCollectionRowTuple.of(
-              "output",
-              outputTuple.get(OUTPUT_TAG).setRowSchema(beamSchema),
-              "errors",
-              outputTuple.get(ERROR_TAG).setRowSchema(ERROR_SCHEMA));
+          PCollectionRowTuple outputRows =  PCollectionRowTuple.of("output",
+              outputTuple.get(OUTPUT_TAG).setRowSchema(beamSchema));
+
+          PCollection<Row> errorOutput = 
outputTuple.get(ERROR_TAG).setRowSchema(ERROR_SCHEMA);
+          if (!failOnError) {

Review Comment:
   I did a quick refactor. There is probably a more elegant solution, but I'm 
trying to get this submitted asap with 2.52



-- 
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]

Reply via email to