slilichenko commented on code in PR #26975:
URL: https://github.com/apache/beam/pull/26975#discussion_r1217515278


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.java:
##########
@@ -3068,6 +3148,17 @@ public WriteResult expand(PCollection<T> input) {
             !getAutoSchemaUpdate(),
             "withAutoSchemaUpdate only supported when using storage-api 
writes.");
       }
+      if (getRowUpdateFn() != null) {
+        if (method != Method.STORAGE_API_AT_LEAST_ONCE) {
+          checkArgument(
+              getRowUpdateFn() == null,
+              "Row updates only supported when using 
STORAGE_API_AT_LEAST_ONCE.");
+        }
+        checkArgument(
+            getCreateDisposition() == CreateDisposition.CREATE_NEVER,
+            "CREATE_IF_NEEDED is not supported when applying row updates. 
Tables must be precreated "
+                + "with a primary key specified.");
+      }

Review Comment:
   The way to do that is to query INFORMATION_SCHEMA 
(https://cloud.google.com/bigquery/docs/information-schema-table-constraints). 
The downside is an extra delay, permissions and complexity. Perhaps at some 
point an optional "withCDCTableValidation" method to make this an explicit 
request?



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