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


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/StorageApiWriteUnshardedRecords.java:
##########
@@ -355,9 +385,31 @@ void invalidateWriteStream() {
         }
       }
 
-      void addMessage(StorageApiWritePayload payload) throws Exception {
+      void addMessage(
+          StorageApiWritePayload payload,
+          OutputReceiver<BigQueryStorageApiInsertError> failedRowsReceiver)
+          throws Exception {
         maybeTickleCache();
         ByteString payloadBytes = ByteString.copyFrom(payload.getPayload());
+        if (autoUpdateSchema) {
+          if (appendClientInfo == null) {
+            appendClientInfo = getAppendClientInfo(true, null);
+          }
+          @Nullable TableRow unknownFields = payload.getUnknownFields();
+          if (unknownFields != null) {
+            try {
+              payloadBytes =
+                  payloadBytes.concat(
+                      Preconditions.checkStateNotNull(appendClientInfo)
+                          .encodeUnknownFields(unknownFields, 
ignoreUnknownValues));
+            } catch (TableRowToStorageApiProto.SchemaConversionException e) {
+              TableRow tableRow = appendClientInfo.toTableRow(payloadBytes);
+              // TODO(reuvenlax): We need to merge the unknown fields in!

Review Comment:
   For now this codepath is disabled. will revisit later.
   



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