ahmedabu98 commented on code in PR #32529: URL: https://github.com/apache/beam/pull/32529#discussion_r1800914398
########## sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/providers/BigQueryStorageWriteApiSchemaTransformProvider.java: ########## @@ -466,11 +530,11 @@ BigQueryIO.Write<Row> createStorageWriteApiTransform(Schema schema) { .withFormatFunction(BigQueryUtils.toTableRow()) .withWriteDisposition(WriteDisposition.WRITE_APPEND); - if (configuration.getTable().equals(DYNAMIC_DESTINATIONS)) { - checkArgument( - schema.getFieldNames().equals(Arrays.asList("destination", "record")), - "When writing to dynamic destinations, we expect Row Schema with a " - + "\"destination\" string field and a \"record\" Row field."); + // in case CDC writes are configured we validate and include them in the configuration + if (Optional.ofNullable(configuration.getUseCdcWrites()).orElse(false)) { + write = validateAndIncludeCDCInformation(write, schema); Review Comment: I see, agreed this looks like the most concise way for now -- 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-unsubscr...@beam.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org