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/07/22 19:04:03 UTC

[GitHub] [beam] kennknowles commented on a diff in pull request #16721: [BEAM-10608] Fix additional nullness errors in BigQueryIO

kennknowles commented on code in PR #16721:
URL: https://github.com/apache/beam/pull/16721#discussion_r927921137


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/RowWriterFactory.java:
##########
@@ -129,7 +127,18 @@ OutputType getOutputType() {
     @Override
     BigQueryRowWriter<ElementT> createRowWriter(String tempFilePrefix, DestinationT destination)
         throws Exception {
+      if (dynamicDestinations == null) {
+        throw new IllegalStateException(
+            "createRowWriter called when dynamicDestinations is null; forgot to call prepare()?");
+      }
+      if (schemaFactory == null) {
+        throw new IllegalStateException(
+            "createRowWriter called when schemaFactory is null; forgot to call prepare()?");
+      }
       TableSchema tableSchema = dynamicDestinations.getSchema(destination);
+      if (tableSchema == null) {

Review Comment:
   SGTM. You'll need to add the requirement that all `schemaFactory` that can be passed in can handle a null.



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