pabloem commented on a change in pull request #16561:
URL: https://github.com/apache/beam/pull/16561#discussion_r788203276



##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/WriteResult.java
##########
@@ -77,13 +96,41 @@ private WriteResult(
       PCollection<TableRow> failedInserts,
       TupleTag<BigQueryInsertError> failedInsertsWithErrTag,
       PCollection<BigQueryInsertError> failedInsertsWithErr,
-      PCollection<TableRow> successfulInserts) {
+      PCollection<TableRow> successfulInserts,
+      TupleTag<TableDestination> successfulInsertsTag,
+      PCollection<TableDestination> successfulBatchInserts) {
     this.pipeline = pipeline;
     this.failedInsertsTag = failedInsertsTag;
     this.failedInserts = failedInserts;
     this.failedInsertsWithErrTag = failedInsertsWithErrTag;
     this.failedInsertsWithErr = failedInsertsWithErr;
     this.successfulInserts = successfulInserts;
+    this.successfulBatchInsertsTag = successfulInsertsTag;
+    this.successfulBatchInserts = successfulBatchInserts;
+  }
+
+  /**
+   * Returns a {@link PCollection} containing the {@link TableDestinations}s 
that were successfully
+   * inserted.
+   *
+   * <p>Successful Inserts are only produced when using batch inserts.
+   */
+  public PCollection<TableDestination> getSuccessfulBatchInserts() {
+    checkArgument(
+        successfulBatchInsertsTag != null,
+        "Cannot use getSuccessfulInserts because this WriteResult was not 
configured "
+            + "to produce them.  Note: streaming inserts do not produce 
successful "
+            + "insert results.");
+
+    return successfulBatchInserts;

Review comment:
       how about `getSuccessfulTableLoads`?




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