You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "reuvenlax (via GitHub)" <gi...@apache.org> on 2023/05/18 00:05:34 UTC

[GitHub] [beam] reuvenlax commented on a diff in pull request #26749: validate all records before publishing

reuvenlax commented on code in PR #26749:
URL: https://github.com/apache/beam/pull/26749#discussion_r1197196295


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/StorageApiWriteUnshardedRecords.java:
##########
@@ -521,9 +521,21 @@ long flush(
                 return ApiFutures.immediateFuture(AppendRowsResponse.newBuilder().build());
               }
               try {
-                StreamAppendClient writeStream =
-                    Preconditions.checkStateNotNull(
-                        getAppendClientInfo(true, null).getStreamAppendClient());
+                AppendClientInfo appendInfo = Preconditions.checkStateNotNull(
+                        getAppendClientInfo(true, null));
+                try {
+                  for (ByteString bytes : c.protoRows.getSerializedRowsList()) {
+                    DynamicMessage.parseFrom(appendInfo.getDescriptor(), bytes);
+                  }
+                } catch (InvalidProtocolBufferException e) {
+                  LOG.error("Failed to parse message destined to " + this.tableUrn + " STREAM " + this.streamName;

Review Comment:
   fixed



-- 
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-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org