maedhroz commented on code in PR #2150:
URL: https://github.com/apache/cassandra/pull/2150#discussion_r1103245659


##########
test/distributed/org/apache/cassandra/distributed/test/accord/AccordCQLTest.java:
##########
@@ -266,6 +269,111 @@ private void testScalarIsNull(String tableDDL) throws 
Exception {
              });
     }
 
+    @Test
+    public void testQueryStaticColumn() throws Exception
+    {
+        test("CREATE TABLE " + currentTable + " (k int, c int, s int static, v 
int, primary key (k, c))",
+             cluster ->
+             {
+                 // select partition key, clustering key and static column, 
restrict on partition and clustering
+                 testQueryStaticColumn(cluster,
+                                       "LET row0 = (SELECT k, c, s, v FROM " + 
currentTable + " WHERE k = ? AND c = 0);\n" +
+                                       "SELECT row0.k, row0.c, row0.s, 
row0.v;\n",
+
+                                       "SELECT k, c, s, v FROM " + 
currentTable + " WHERE k = ? AND c = 0");
+
+                 // select partition key, clustering key and static column, 
restrict on partition and limit to 1 row
+                 testQueryStaticColumn(cluster,
+                                       "LET row0 = (SELECT k, c, s, v FROM " + 
currentTable + " WHERE k = ? LIMIT 1);\n" +
+                                       "SELECT row0.k, row0.c, row0.s, 
row0.v;\n",
+
+                                       "SELECT k, c, s, v FROM " + 
currentTable + " WHERE k = ? LIMIT 1");
+
+                 // select just static column, restrict on partition and 
clustering

Review Comment:
   Ah, yeah, in that case, makes sense, although I'd just update the comment?



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