You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sylvain Lebresne (JIRA)" <ji...@apache.org> on 2014/12/12 12:02:14 UTC

[jira] [Resolved] (CASSANDRA-8456) Some valid index queries can be considered as invalid

     [ https://issues.apache.org/jira/browse/CASSANDRA-8456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Lebresne resolved CASSANDRA-8456.
-----------------------------------------
    Resolution: Not a Problem

bq. As there are no good reasons while we can not execute those queries we should for sure fix the problem. 

Yeah but that is then a duplicate of CASSANDRA-6377/CASSANDRA-4987 so let me close this ticket.


> Some valid index queries can be considered as invalid
> -----------------------------------------------------
>
>                 Key: CASSANDRA-8456
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8456
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Benjamin Lerer
>            Assignee: Benjamin Lerer
>
> Some secondary index queries are rejected or need ALLOW FILTERING but should not. It seems that in certain case {{SelectStatement}} use index filtering for clustering column restrictions while it should be using clustering column slices.
> The following unit tests can be used to reproduce the problem in 3.0
> {code}
>     @Test
>     public void testMultipleClusteringWithIndex() throws Throwable
>     {
>         createTable("CREATE TABLE %s (a int, b int, c int, d int, e int, PRIMARY KEY (a, b, c, d))");
>         createIndex("CREATE INDEX ON %s (b)");
>         createIndex("CREATE INDEX ON %s (e)");
>         execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 0, 0, 0, 0);
>         execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 0, 1, 0, 1);
>         execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 0, 1, 1, 2);
>         execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 0, 0, 0);
>         execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 1, 0, 1);
>         execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 1, 1, 2);
>         execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 2, 0, 0, 0);
>         assertRows(execute("SELECT * FROM %s WHERE (b, c) = (?, ?)", 1, 1),
>                    row(0, 1, 1, 0, 1),
>                    row(0, 1, 1, 1, 2));
>     }
>     @Test
>     public void testMultiplePartitionKeyAndMultiClusteringWithIndex() throws Throwable
>     {
>         createTable("CREATE TABLE %s (a int, b int, c int, d int, e int, f int, PRIMARY KEY ((a, b), c, d, e))");
>         createIndex("CREATE INDEX ON %s (c)");
>         createIndex("CREATE INDEX ON %s (f)");
>         execute("INSERT INTO %s (a, b, c, d, e, f) VALUES (?, ?, ?, ?, ?, ?)", 0, 0, 0, 0, 0, 0);
>         execute("INSERT INTO %s (a, b, c, d, e, f) VALUES (?, ?, ?, ?, ?, ?)", 0, 0, 0, 1, 0, 1);
>         execute("INSERT INTO %s (a, b, c, d, e, f) VALUES (?, ?, ?, ?, ?, ?)", 0, 0, 0, 1, 1, 2);
>         execute("INSERT INTO %s (a, b, c, d, e, f) VALUES (?, ?, ?, ?, ?, ?)", 0, 0, 1, 0, 0, 3);
>         execute("INSERT INTO %s (a, b, c, d, e, f) VALUES (?, ?, ?, ?, ?, ?)", 0, 0, 1, 1, 0, 4);
>         execute("INSERT INTO %s (a, b, c, d, e, f) VALUES (?, ?, ?, ?, ?, ?)", 0, 0, 1, 1, 1, 5);
>         execute("INSERT INTO %s (a, b, c, d, e, f) VALUES (?, ?, ?, ?, ?, ?)", 0, 0, 2, 0, 0, 6);
>         assertRows(execute("SELECT * FROM %s WHERE a = ? AND (c) IN ((?), (?)) AND f = ?", 0, 1, 2, 5),
>                    row(0, 0, 1, 1, 1, 5));
>         assertRows(execute("SELECT * FROM %s WHERE a = ? AND (c, d) IN ((?, ?)) AND f = ?", 0, 1, 1, 5),
>                    row(0, 0, 1, 1, 1, 5));
>         assertRows(execute("SELECT * FROM %s WHERE a = ? AND (c) >= (?) AND f = ?", 0, 1, 5),
>                    row(0, 0, 1, 1, 1, 5));
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)