-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Description
What happened?
In beam 2.39, this used to work:
BigQueryIO
.write()
.optimizedWrites()
.to(OutputTable)
.withAvroFormatFunction(abc)
.withAvroSchemaFactory(xyz)
.withCreateDisposition(CreateDisposition.CREATE_NEVER)
.withWriteDisposition(WriteDisposition.WRITE_TRUNCATE))
but now throws an exception if you end up in MultiPartitionsWriteTables:
Caused by: java.lang.IllegalArgumentException: Unless create disposition is CREATE_NEVER, a schema must be specified, i.e. DynamicDestinations.getSchema() may not return null. However, create disposition is CREATE_IF_NEEDED, and org.apache.beam.sdk.io.gcp.bigquery.DynamicDestinationsHelpers$ConstantTableDestinations@52e95e1 returned null for destination tableSpec: <table>
at org.apache.beam.sdk.util.Preconditions.checkArgumentNotNull(Preconditions.java:436)
at org.apache.beam.sdk.io.gcp.bigquery.WriteTables$WriteTablesDoFn.processElement(WriteTables.java:207)
The reason seems like now, the create disposition is set to CreateDisposition.CREATE_IF_NEEDED in WriteTables no matter what the user sets it to.
Issue Priority
Priority: 2
Issue Component
Component: io-java-gcp