You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/08/18 00:46:56 UTC

[GitHub] [beam] thiagotnunes commented on a diff in pull request #22769: [BEAM-12164] Feat: Added support to Cloud Spanner Change Streams connector for including transaction tags in the Change Stream records

thiagotnunes commented on code in PR #22769:
URL: https://github.com/apache/beam/pull/22769#discussion_r948555250


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/changestreams/mapper/ChangeStreamRecordMapper.java:
##########
@@ -253,6 +255,8 @@ private DataChangeRecord toDataChangeRecord(
         valueCaptureTypeFrom(row.getString(VALUE_CAPTURE_TYPE_COLUMN)),
         row.getLong(NUMBER_OF_RECORDS_IN_TRANSACTION_COLUMN),
         row.getLong(NUMBER_OF_PARTITIONS_IN_TRANSACTION_COLUMN),
+        row.getString(TRANSACTION_TAG),

Review Comment:
   Are these always present or can they be `null`? If the latter is true, you have to do `row.isNull(TRANSACTION_TAG) ? null : row.getString(TRANSACTION_TAG)`



##########
sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/changestreams/mapper/ChangeStreamRecordMapperTest.java:
##########
@@ -99,6 +99,8 @@ public void testMappingUpdateStructRowToDataChangeRecord() {
             ValueCaptureType.OLD_AND_NEW_VALUES,
             10L,
             2L,
+            "transactionTag",

Review Comment:
   If the transaction tag could be null, could you add a test?



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