johnjcasey commented on code in PR #30081:
URL: https://github.com/apache/beam/pull/30081#discussion_r1491375967


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/WriteBundlesToFiles.java:
##########
@@ -234,17 +245,28 @@ public void processElement(
 
     try {
       writer.write(element.getValue());
-    } catch (Exception e) {
-      // Discard write result and close the write.
+    } catch (BigQueryRowSerializationException e) {
       try {
-        writer.close();
-        // The writer does not need to be reset, as this DoFn cannot be reused.
-      } catch (Exception closeException) {
-        // Do not mask the exception that caused the write to fail.
-        e.addSuppressed(closeException);
+        badRecordRouter.route(
+            outputReceiver, element, coder, e, "Unable to Write BQ Record to 
File");
+      } catch (Exception e2) {
+        cleanupWriter(writer, e2);
       }
-      throw e;
+    } catch (IOException e) {

Review Comment:
   ty



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