[
https://issues.apache.org/jira/browse/CASSANDRA-4987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14235370#comment-14235370
]
Rajanarayanan Thottuvaikkatumana commented on CASSANDRA-4987:
-------------------------------------------------------------
[~slebresne], I had a look at the code and the here is one place where a change
can be made. In the org/apache/cassandra/cql3/statements/SelectStatement.java
file, this conditional check to be introduced
{code}
if(!parameters.allowFiltering)
{
secondaryIndexManager.validateIndexSearchersForQuery(expressions);
}
{code}
In the org/apache/cassandra/db/index/SecondaryIndexManager.java file, change
the exception message to give hint about the ALLOW FILTERING CLAUSE
{code}
StringBuilder sb = new StringBuilder("No secondary indexes on the restricted
columns support the provided operators. If you want to execute this query
despite the performance unpredictability, use ALLOW FILTERING: ");
{code}
If we make the above changes, the behaviour will be something like given below.
{code}
cqlsh> use test;
cqlsh:test> select * from Videos;
videoid | videoname | description | tags | upload_date | username
---------+-----------+-------------+------+-------------+----------
(0 rows)
cqlsh:test> select * from videos where tags = 'Cass';
code=2200 [Invalid query] message="No secondary indexes on the restricted
columns support the provided operators. If you want to execute this query
despite the performance unpredictability, use ALLOW FILTERING: "
cqlsh:test> select * from videos where tags = 'Cass' ALLOW FILTERING;
videoid | videoname | description | tags | upload_date | username
---------+-----------+-------------+------+-------------+----------
(0 rows)
cqlsh:test>
{code}
I will have a look at other places where there is a change required. Please let
me know if this is right and a patch needs to be generated. Thanks
> Support more queries when ALLOW FILTERING is used.
> --------------------------------------------------
>
> Key: CASSANDRA-4987
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4987
> Project: Cassandra
> Issue Type: Improvement
> Reporter: Sylvain Lebresne
> Labels: cql
> Fix For: 3.0
>
>
> Even after CASSANDRA-4915, there is still a bunch of queries that we don't
> support even if {{ALLOW FILTERING}} is used. Typically, pretty much any
> queries with restriction on a non-primary-key column unless we have one of
> those restriction that is an EQ on an indexed column.
> If {{ALLOW FILTERING}} is used, we could allow those queries out of
> convenience.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)