steveniemitz commented on code in PR #16721:
URL: https://github.com/apache/beam/pull/16721#discussion_r921713065
##########
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:
This looks like a regression, in the past it was legal for `tableSchema` to
be null here, as long as `schemaFactory` didn't require it. I'm going to
submit a PR to revert this specific null check.
--
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]