blerer commented on a change in pull request #1159:
URL: https://github.com/apache/cassandra/pull/1159#discussion_r703546071



##########
File path: 
test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
##########
@@ -1930,4 +1930,38 @@ public void testInvalidColumnNames() throws Throwable
         assertInvalidMessage("Undefined column name e", "SELECT c AS e FROM %s 
WHERE (b, e) IN ((0, 1), (2, 4))");
         assertInvalidMessage("Undefined column name e", "SELECT c AS e FROM %s 
WHERE (b, e) > (0, 1) and b <= 2");
     }
+
+    @Test
+    public void testInRestrictionsWithAllowFiltering() throws Throwable
+    {
+        createTable("CREATE TABLE %s (pk int, c1 text, c2 int, v int, primary 
key(pk, c1, c2))");
+        execute("INSERT INTO %s (pk, c1, c2, v) values (?, ?, ?, ?)", 1, "0", 
0, 3);
+        execute("INSERT INTO %s (pk, c1, c2, v) values (?, ?, ?, ?)", 1, "1", 
0, 4);
+        execute("INSERT INTO %s (pk, c1, c2, v) values (?, ?, ?, ?)", 1, "1", 
1, 5);
+        execute("INSERT INTO %s (pk, c1, c2, v) values (?, ?, ?, ?)", 1, "2", 
1, 6);
+        execute("INSERT INTO %s (pk, c1, c2, v) values (?, ?, ?, ?)", 1, "2", 
2, 7);
+
+        assertRows(execute("SELECT * FROM %s WHERE (c2) IN ((?), (?)) ALLOW 
FILTERING", 1, 3),
+                   row(1, "1", 1, 5),
+                   row(1, "2", 1, 6));
+
+        assertRows(execute("SELECT * FROM %s WHERE c2 IN (?, ?) ALLOW 
FILTERING", 1, 3),
+                   row(1, "1", 1, 5),
+                   row(1, "2", 1, 6));
+    }
+
+    @Test
+    public void testInRestrictionsWithIndex() throws Throwable
+    {
+        createTable("CREATE TABLE %s (pk int, c1 text, c2 int, c3 int, v int, 
primary key(pk, c1, c2, c3))");
+        createIndex("CREATE INDEX ON %s (c3)");

Review comment:
       I was surprised to hit the error. I did not realize that I had kept the 
`ALLOW FILTERING`. I should have looked deeper.
   
   The error message is not making sense at all. I did not changed it by 
laziness. So +1 to the change.
   
   




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