[
https://issues.apache.org/jira/browse/CASSANDRA-10958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Taiyuan Zhang updated CASSANDRA-10958:
--------------------------------------
Description:
I'm playing with Cassandra 3. I added a secondary index on a column of
integer, then I want to do a range query. First it threw an error:
{code}
InvalidRequest: code=2200 [Invalid query] message="No supported secondary
index found for the non primary key columns restrictions"
{code}
So I added 'Allow Filtering'
cqlsh:mykeyspace> SELECT * FROM test ;
id | id2 | age | extra
----+-----+-----+-------
1 | 1 | 1 | 1
2 | 2 | 2 | 2
(2 rows)
cqlsh:mykeyspace > CREATE INDEX test_age on test (extra) ;
cqlsh:mykeyspace > select * FROM test WHERE extra < 2 ALLOW FILTERING ;
id | id2 | age | extra
----+------+-----+-------
1 | 1 | 1 | 1
2 | null | 2 | null
(2 rows)
My schema is:
CREATE TABLE mykeyspace.test (
id int,
id2 int,
age int static,
extra int,
PRIMARY KEY (id, id2)
)
It certainly looks like a BUG to me, even though it has a chance to be
something by-design.
was:
I'm playing with Cassandra 3. I added a secondary index on a column of
integer, then I want to do a range query. First it threw an error:
InvalidRequest: code=2200 [Invalid query] message="No supported secondary
index found for the non primary key columns restrictions"
So I added 'Allow Filtering'
cqlsh:mykeyspace> SELECT * FROM test ;
id | id2 | age | extra
----+-----+-----+-------
1 | 1 | 1 | 1
2 | 2 | 2 | 2
(2 rows)
cqlsh:mykeyspace > CREATE INDEX test_age on test (extra) ;
cqlsh:mykeyspace > select * FROM test WHERE extra < 2 ALLOW FILTERING ;
id | id2 | age | extra
----+------+-----+-------
1 | 1 | 1 | 1
2 | null | 2 | null
(2 rows)
My schema is:
CREATE TABLE mykeyspace.test (
id int,
id2 int,
age int static,
extra int,
PRIMARY KEY (id, id2)
)
It certainly looks like a BUG to me, even though it has a chance to be
something by-design.
> Range query using secondary index returns weird results
> -------------------------------------------------------
>
> Key: CASSANDRA-10958
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10958
> Project: Cassandra
> Issue Type: Bug
> Reporter: Taiyuan Zhang
> Priority: Minor
>
> I'm playing with Cassandra 3. I added a secondary index on a column of
> integer, then I want to do a range query. First it threw an error:
> {code}
> InvalidRequest: code=2200 [Invalid query] message="No supported secondary
> index found for the non primary key columns restrictions"
> {code}
> So I added 'Allow Filtering'
> cqlsh:mykeyspace> SELECT * FROM test ;
> id | id2 | age | extra
> ----+-----+-----+-------
> 1 | 1 | 1 | 1
> 2 | 2 | 2 | 2
> (2 rows)
> cqlsh:mykeyspace > CREATE INDEX test_age on test (extra) ;
> cqlsh:mykeyspace > select * FROM test WHERE extra < 2 ALLOW FILTERING ;
> id | id2 | age | extra
> ----+------+-----+-------
> 1 | 1 | 1 | 1
> 2 | null | 2 | null
> (2 rows)
> My schema is:
> CREATE TABLE mykeyspace.test (
> id int,
> id2 int,
> age int static,
> extra int,
> PRIMARY KEY (id, id2)
> )
> It certainly looks like a BUG to me, even though it has a chance to be
> something by-design.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)