You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "yifan-c (via GitHub)" <gi...@apache.org> on 2026/10/16 17:52:11 UTC

Re: [PR] CASSSIDECAR-507: CDC fails to deserialize nested UDT columns [cassandra-sidecar]

yifan-c commented on code in PR #394:
URL: https://github.com/apache/cassandra-sidecar/pull/394#discussion_r4288793957


##########
integration-tests/src/integrationTest/org/apache/cassandra/sidecar/cdc/CdcIntegrationTest.java:
##########
@@ -171,6 +195,57 @@ void testBatchMixingCdcAndNonCdcTableDoesNotDropCdcMutation()
         .noneMatch(event -> event.table.equals(NON_CDC_TABLE.table()));
     }
 
+    @Test
+    void testUdtColumnsArePublishedAsAvroRecords() throws IOException
+    {
+        String query = String.format("INSERT INTO %s (id, results) VALUES (1, " +
+                                     "[{status: 'SUCCESS', message: 'completed'}, {status: 'FAILED', message: 'timed out'}])",
+                                     UDT_TABLE);
+        cluster.getFirstRunningInstance()
+               .coordinator()
+               .execute(query, ConsistencyLevel.ONE);
+
+        // Seal the active commit log segment so CDC can find the mutation in cdc_raw
+        cluster.getFirstRunningInstance().flush(UDT_TABLE.keyspace());
+
+        TestCdcEventConsumer consumer = getTestEventConsumer();
+        waitUntil(() -> consumer.getEvents().stream().anyMatch(event -> event.table.equals(UDT_TABLE.table())), 120, 1000);
+        CdcEvent event = consumer.getEvents().stream()
+                                 .filter(e -> e.table.equals(UDT_TABLE.table()))
+                                 .findFirst()
+                                 .orElseThrow(AssertionError::new);

Review Comment:
   Shouldn't `waitUntil` already throw if there is no match? 
   
   nit: you can record the found event and use it later. 
   
   ```java
           AtomicReference<CdcEvent> cdcEvent = new AtomicReference<>();
           waitUntil(() -> consumer.getEvents().stream().anyMatch(event -> {
               boolean found = event.table.equals(UDT_TABLE.table());
               cdcEvent.set(event);
               return found;
           }), 120, 1000);
   ```



-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org