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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to