You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/01/28 21:04:18 UTC

[GitHub] [beam] kmjung commented on a change in pull request #16644: [BEAM-13768] Fix NullPointerException in BigQueryStorageSourceBase

kmjung commented on a change in pull request #16644:
URL: https://github.com/apache/beam/pull/16644#discussion_r794888197



##########
File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryStorageSourceBase.java
##########
@@ -107,17 +104,19 @@
     BigQueryOptions bqOptions = options.as(BigQueryOptions.class);
     Table targetTable = getTargetTable(bqOptions);
 
-    String tableReferenceId = "";
+    ReadSession.Builder readSessionBuilder = ReadSession.newBuilder();
     if (targetTable != null) {
-      tableReferenceId = BigQueryHelpers.toTableResourceName(targetTable.getTableReference());
+      readSessionBuilder.setTable(
+          BigQueryHelpers.toTableResourceName(targetTable.getTableReference()));
     } else {
       // If the table does not exist targetTable will be null.
       // Construct the table id if we can generate it. For error recording/logging.
-      tableReferenceId = getTargetTableId(bqOptions);
+      @Nullable String tableReferenceId = getTargetTableId(bqOptions);

Review comment:
       I don't understand why we would ever want to return null from a call to `getTargetTableId`. Either the table should exist and be readable or we should have raised an exception prior to this point.




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