You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "pabloem (via GitHub)" <gi...@apache.org> on 2023/05/30 19:39:47 UTC

[GitHub] [beam] pabloem commented on a diff in pull request #25195: Fixing a table existence verifier for BQ

pabloem commented on code in PR #25195:
URL: https://github.com/apache/beam/pull/25195#discussion_r1210743421


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryHelpers.java:
##########
@@ -593,10 +593,15 @@ static String getDatasetLocation(
 
   static void verifyTablePresence(DatasetService datasetService, TableReference table) {
     try {
-      datasetService.getTable(table);
+      Table fetchedTable = datasetService.getTable(table);
+      if (fetchedTable == null) {
+        throw new IOException("Table does not exist.");

Review Comment:
   ah note that this exception is caught again on line 603 and formatted properly. Why do we do this? because `datasetService.getTable` can also throw an exception so we deal with both cases there



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org