aweisberg commented on code in PR #4684:
URL: https://github.com/apache/cassandra/pull/4684#discussion_r2977193613


##########
test/distributed/org/apache/cassandra/distributed/test/accord/AccordCQLTestBase.java:
##########
@@ -330,6 +338,79 @@ public void testPartitionMultiRowReturn() throws Exception
         });
     }
 
+    @Test
+    public void testSinglePartitionKeyBatch() throws Throwable
+    {
+        List<String> ddls = Arrays.asList("DROP KEYSPACE IF EXISTS " + 
KEYSPACE + ';',
+                                          "CREATE KEYSPACE " + KEYSPACE + " 
WITH REPLICATION={'class':'SimpleStrategy', 'replication_factor': 3}",
+                                          "CREATE TABLE " + 
qualifiedAccordTableName + " (k int PRIMARY KEY, v int) WITH 
transactional_mode='full'",
+                                          "CREATE TABLE " + 
qualifiedRegularTableName + " (k int PRIMARY KEY, v int)");
+
+        test(ddls, cluster -> {
+            cluster.coordinator(1).execute("BEGIN BATCH\n" +
+                                           "INSERT INTO " + 
qualifiedAccordTableName + " (k, v) VALUES (1, 2);\n" +
+                                           "INSERT INTO " + 
qualifiedRegularTableName + " (k, v) VALUES (1, 3);\n" +
+                                           "APPLY BATCH;", 
ConsistencyLevel.ONE);
+
+            SimpleQueryResult r1 = 
cluster.coordinator(1).executeWithResult("SELECT * FROM " + 
qualifiedAccordTableName + " WHERE k = 1", ConsistencyLevel.ONE);
+            SimpleQueryResult r2 = 
cluster.coordinator(1).executeWithResult("SELECT * FROM " + 
qualifiedRegularTableName + " WHERE k = 1", ConsistencyLevel.ONE);
+
+            assertEquals(1, r1.toObjectArrays().length);
+            assertEquals(1, r2.toObjectArrays().length);
+        });
+    }
+
+    @Test
+    public void testSinglePartitionKeyBatchWrittenToBatchLog() throws Throwable
+    {
+        DatabaseDescriptor.daemonInitialization();
+        List<String> ddls = Arrays.asList("DROP KEYSPACE IF EXISTS " + 
KEYSPACE + ';',
+                                          "CREATE KEYSPACE " + KEYSPACE + " 
WITH REPLICATION={'class':'SimpleStrategy', 'replication_factor': 3}",
+                                          "CREATE TABLE " + 
qualifiedAccordTableName + " (k int PRIMARY KEY, v int) WITH 
transactional_mode='full'",

Review Comment:
   Same use the transactional mode from the derived test.



##########
test/distributed/org/apache/cassandra/distributed/test/accord/AccordCQLTestBase.java:
##########
@@ -330,6 +338,79 @@ public void testPartitionMultiRowReturn() throws Exception
         });
     }
 
+    @Test
+    public void testSinglePartitionKeyBatch() throws Throwable
+    {
+        List<String> ddls = Arrays.asList("DROP KEYSPACE IF EXISTS " + 
KEYSPACE + ';',
+                                          "CREATE KEYSPACE " + KEYSPACE + " 
WITH REPLICATION={'class':'SimpleStrategy', 'replication_factor': 3}",
+                                          "CREATE TABLE " + 
qualifiedAccordTableName + " (k int PRIMARY KEY, v int) WITH 
transactional_mode='full'",

Review Comment:
   It would be good to use the transactional mode from whatever derived class 
this test is currently using



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to