File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/providers Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 2020import static org .apache .beam .sdk .util .construction .BeamUrns .getUrn ;
2121
2222import com .google .auto .service .AutoService ;
23+ import java .util .Arrays ;
24+ import java .util .List ;
2325import org .apache .beam .model .pipeline .v1 .ExternalTransforms ;
2426import org .apache .beam .sdk .annotations .Internal ;
2527import org .apache .beam .sdk .schemas .NoSuchSchemaException ;
@@ -47,6 +49,11 @@ public String identifier() {
4749 return getUrn (ExternalTransforms .ManagedTransforms .Urns .BIGQUERY_WRITE );
4850 }
4951
52+ @ Override
53+ public List <String > outputCollectionNames () {
54+ return Arrays .asList ("FailedRows" , "FailedRowsWithErrors" , "errors" );
55+ }
56+
5057 @ Override
5158 protected SchemaTransform from (BigQueryWriteConfiguration configuration ) {
5259 return new BigQueryWriteSchemaTransform (configuration );
@@ -62,9 +69,10 @@ public static class BigQueryWriteSchemaTransform extends SchemaTransform {
6269
6370 @ Override
6471 public PCollectionRowTuple expand (PCollectionRowTuple input ) {
65- if (input .getSinglePCollection ().isBounded ().equals (PCollection .IsBounded .BOUNDED )) {
72+ if (input .getSinglePCollection ().isBounded ().equals (PCollection .IsBounded .BOUNDED )
73+ && configuration .getErrorHandling () == null ) {
6674 return input .apply (new BigQueryFileLoadsSchemaTransformProvider ().from (configuration ));
67- } else { // UNBOUNDED
75+ } else { // UNBOUNDED or error handling specified
6876 return input .apply (
6977 new BigQueryStorageWriteApiSchemaTransformProvider ().from (configuration ));
7078 }
You can’t perform that action at this time.
0 commit comments