Class HealthcareIOErrorToTableRow<T>
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.healthcare.HealthcareIOErrorToTableRow<T>
-
- Type Parameters:
T
- the type parameter for theHealthcareIOError
- All Implemented Interfaces:
java.io.Serializable
,org.apache.beam.sdk.transforms.ProcessFunction<HealthcareIOError<T>,com.google.api.services.bigquery.model.TableRow>
,org.apache.beam.sdk.transforms.SerializableFunction<HealthcareIOError<T>,com.google.api.services.bigquery.model.TableRow>
public class HealthcareIOErrorToTableRow<T> extends java.lang.Object implements org.apache.beam.sdk.transforms.SerializableFunction<HealthcareIOError<T>,com.google.api.services.bigquery.model.TableRow>
Convenience transform to write dead-letterHealthcareIOError
s to BigQueryTableRow
s.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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.List<com.google.api.services.bigquery.model.TableFieldSchema>
TABLE_FIELD_SCHEMAS
static java.lang.String
TIMESTAMP_FIELD_NAME
-
Constructor Summary
Constructors Constructor Description HealthcareIOErrorToTableRow()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.api.services.bigquery.model.TableRow
apply(HealthcareIOError<T> err)
-
-
-
Field Detail
-
TIMESTAMP_FIELD_NAME
public static final java.lang.String TIMESTAMP_FIELD_NAME
- See Also:
- Constant Field Values
-
TABLE_FIELD_SCHEMAS
public static final java.util.List<com.google.api.services.bigquery.model.TableFieldSchema> TABLE_FIELD_SCHEMAS
-
-
Method Detail
-
apply
public com.google.api.services.bigquery.model.TableRow apply(HealthcareIOError<T> err)
- Specified by:
apply
in interfaceorg.apache.beam.sdk.transforms.ProcessFunction<HealthcareIOError<T>,com.google.api.services.bigquery.model.TableRow>
- Specified by:
apply
in interfaceorg.apache.beam.sdk.transforms.SerializableFunction<HealthcareIOError<T>,com.google.api.services.bigquery.model.TableRow>
-
-