nickuncaged1201 commented on code in PR #27039:
URL: https://github.com/apache/beam/pull/27039#discussion_r1237440482


##########
sdks/java/io/file-schema-transform/src/main/java/org/apache/beam/sdk/io/fileschematransform/FileWriteSchemaTransformFormatProviders.java:
##########
@@ -61,6 +73,49 @@ static MapElements<Row, GenericRecord> 
mapRowsToGenericRecords(Schema beamSchema
         
.via(AvroUtils.getRowToGenericRecordFunction(AvroUtils.toAvroSchema(beamSchema)));
   }
 
+  // Applies generic mapping from Beam row to other data types through the 
provided mapFn.
+  // Implemenets error handling with metrics and DLQ support.
+  // Arguments:
+  //    name: the metric name to use.
+  //    mapFn: the mapping function for mapping from Beam row to other data 
types.
+  //    outputTag: TupleTag for output. Used to direct output to correct 
output source, or in the
+  //        case of error, a DLQ.
+  static class ErrorCounterFn<OutputT extends Object> extends DoFn<Row, 
OutputT> {

Review Comment:
   Done. Changed name to `BeamRowMapperWithDlq`, and added a generic test 
independent of any format.



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