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


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/testing/FakeDatasetService.java:
##########
@@ -586,11 +639,35 @@ public ApiFuture<AppendRowsResponse> appendRows(long 
offset, ProtoRows rows)
             }
             TableRow tableRow =
                 TableRowToStorageApiProto.tableRowFromMessage(
-                    DynamicMessage.parseFrom(protoDescriptor, bytes));
+                    DynamicMessage.parseFrom(protoDescriptor, bytes), false);
             if (shouldFailRow.apply(tableRow)) {
               rowIndexToErrorMessage.put(i, "Failing row " + 
tableRow.toPrettyString());
             }
-            tableRows.add(tableRow);
+            String insertTypeStr = null;
+            long csn = -1;
+            Descriptors.FieldDescriptor fieldDescriptor =
+                protoDescriptor.findFieldByName("_CHANGE_TYPE");
+            if (fieldDescriptor != null) {
+              insertTypeStr = (String) msg.getField(fieldDescriptor);
+            }
+            fieldDescriptor = 
protoDescriptor.findFieldByName("_CHANGE_SEQUENCE_NUMBER");
+            if (fieldDescriptor != null) {
+              csn = (long) msg.getField(fieldDescriptor);
+            }
+            Stream.Entry.UpdateType insertType = 
Stream.Entry.UpdateType.INSERT;

Review Comment:
   It's used internally, and also validates that we don't accidentally use the 
same stream object for both CDC and inserts



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