Class HealthcareIOErrorToTableRow<T>

java.lang.Object
org.apache.beam.sdk.io.gcp.healthcare.HealthcareIOErrorToTableRow<T>
Type Parameters:
T - the type parameter for the HealthcareIOError
All Implemented Interfaces:
Serializable, ProcessFunction<HealthcareIOError<T>,TableRow>, SerializableFunction<HealthcareIOError<T>,TableRow>

public class HealthcareIOErrorToTableRow<T> extends Object implements SerializableFunction<HealthcareIOError<T>,TableRow>
Convenience transform to write dead-letter HealthcareIOErrors to BigQuery TableRows.

This can be used with BigQueryIO.Write.withSchema(TableSchema) by defining a dead letter table schema


 ...
 PCollection<HealthcareIOError<String>> errors = ...;

 TableSchema deadLetterSchema = new TableSchema();
 deadLetterSchema.setFields(HealthcareIOErrorToTableRow.TABLE_FIELD_SCHEMAS);
 TimePartitioning deadLetterPartitioning = new TimeParitioning();
 deadLetterPartitioning.setField(HealthcareIOErrorToTableRow.TIMESTAMP_FIELD_NAME);

 errors.apply(
    BigQueryIO.write()
      .to(options.getDeadLetterTable())
      .withFormatFunction(new HealthcareIOErrorToTableRow())
      .withSchema(deadLetterSchema)
      .withTimePartitioning(deadLetterPartitioning)
 );
 ***
 
See Also: