This is an automated email from the ASF dual-hosted git repository.

virajjasani pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/phoenix-adapters.git


The following commit(s) were added to refs/heads/main by this push:
     new b41031c  Add change stream record fields for KCL parity
b41031c is described below

commit b41031c2e39db968215cbc88c05a1cbcd4727b32
Author: Palash Chauhan <[email protected]>
AuthorDate: Tue May 12 16:27:40 2026 -0700

    Add change stream record fields for KCL parity
    
    Co-authored-by: Claude Opus 4.6 <[email protected]>
---
 .../java/org/apache/phoenix/ddb/service/GetRecordsService.java     | 3 +++
 .../src/test/java/org/apache/phoenix/ddb/GetRecordsIT.java         | 4 ++++
 .../src/test/java/org/apache/phoenix/ddb/TestUtils.java            | 6 ++++++
 .../src/main/java/org/apache/phoenix/ddb/utils/ApiMetadata.java    | 7 +++++++
 4 files changed, 20 insertions(+)

diff --git 
a/phoenix-ddb-rest/src/main/java/org/apache/phoenix/ddb/service/GetRecordsService.java
 
b/phoenix-ddb-rest/src/main/java/org/apache/phoenix/ddb/service/GetRecordsService.java
index 4a49500..e5070a2 100644
--- 
a/phoenix-ddb-rest/src/main/java/org/apache/phoenix/ddb/service/GetRecordsService.java
+++ 
b/phoenix-ddb-rest/src/main/java/org/apache/phoenix/ddb/service/GetRecordsService.java
@@ -213,6 +213,9 @@ public class GetRecordsService {
             record.put(ApiMetadata.EVENT_NAME, "MODIFY");
         }
         record.put(ApiMetadata.EVENT_ID, 
DdbAdapterCdcUtils.getEventId(tableName, partitionId, seqNum));
+        record.put(ApiMetadata.EVENT_VERSION, ApiMetadata.EVENT_VERSION_VALUE);
+        record.put(ApiMetadata.EVENT_SOURCE, ApiMetadata.EVENT_SOURCE_VALUE);
+        record.put(ApiMetadata.AWS_REGION, ApiMetadata.AWS_REGION_VALUE);
         return record;
     }
 }
diff --git 
a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsIT.java 
b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsIT.java
index 5595070..de49648 100644
--- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsIT.java
+++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/GetRecordsIT.java
@@ -30,6 +30,7 @@ import 
org.apache.phoenix.thirdparty.com.google.common.collect.Maps;
 import org.apache.phoenix.util.PhoenixRuntime;
 import org.apache.phoenix.util.ReadOnlyProps;
 import org.apache.phoenix.util.ServerUtil;
+import org.apache.phoenix.ddb.utils.ApiMetadata;
 import org.apache.phoenix.ddb.utils.PhoenixUtils;
 
 import org.junit.AfterClass;
@@ -490,6 +491,9 @@ public class GetRecordsIT {
         Assert.assertNotNull("eventID must be present", 
phoenixRecord.eventID());
         Assert.assertTrue("eventID must be 32-char hex",
                 phoenixRecord.eventID().matches("[0-9a-f]{32}"));
+        Assert.assertEquals(ApiMetadata.EVENT_VERSION_VALUE, 
phoenixRecord.eventVersion());
+        Assert.assertEquals(ApiMetadata.EVENT_SOURCE_VALUE, 
phoenixRecord.eventSource());
+        Assert.assertEquals(ApiMetadata.AWS_REGION_VALUE, 
phoenixRecord.awsRegion());
     }
 
 }
diff --git 
a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/TestUtils.java 
b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/TestUtils.java
index f1a5fe7..7b42ca1 100644
--- a/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/TestUtils.java
+++ b/phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/TestUtils.java
@@ -251,6 +251,12 @@ public class TestUtils {
                     dr.dynamodb().sizeBytes() > 0);
             Assert.assertTrue("Phoenix record size should be greater than 0 
for record " + i,
                     pr.dynamodb().sizeBytes() > 0);
+            Assert.assertEquals("eventVersion should match for record " + i, 
dr.eventVersion(),
+                    pr.eventVersion());
+            Assert.assertEquals("eventSource should match for record " + i, 
dr.eventSource(),
+                    pr.eventSource());
+            Assert.assertEquals("Phoenix awsRegion should match for record " + 
i,
+                    ApiMetadata.AWS_REGION_VALUE, pr.awsRegion());
         }
         assertEventIdsUnique(phoenixRecords);
     }
diff --git 
a/phoenix-ddb-utils/src/main/java/org/apache/phoenix/ddb/utils/ApiMetadata.java 
b/phoenix-ddb-utils/src/main/java/org/apache/phoenix/ddb/utils/ApiMetadata.java
index 9df9dfa..ca2793b 100644
--- 
a/phoenix-ddb-utils/src/main/java/org/apache/phoenix/ddb/utils/ApiMetadata.java
+++ 
b/phoenix-ddb-utils/src/main/java/org/apache/phoenix/ddb/utils/ApiMetadata.java
@@ -156,10 +156,17 @@ public class ApiMetadata {
     public static final String KEYS = "Keys";
     public static final String SIZE_BYTES = "SizeBytes";
     public static final String EVENT_ID = "eventID";
+    public static final String EVENT_VERSION = "eventVersion";
+    public static final String EVENT_SOURCE = "eventSource";
+    public static final String AWS_REGION = "awsRegion";
     public static final String USER_IDENTITY = "userIdentity";
     public static final String TYPE = "Type";
     public static final String PRINCIPAL_ID = "PrincipalId";
 
+    public static final String EVENT_VERSION_VALUE = "1.1";
+    public static final String EVENT_SOURCE_VALUE = "aws:dynamodb";
+    public static final String AWS_REGION_VALUE = "us-west-2";
+
     // API Operation Names
     public static final String CREATE_TABLE = "CreateTable";
     public static final String DELETE_TABLE = "DeleteTable";

Reply via email to