[ https://issues.apache.org/jira/browse/CASSANDRA-6950?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tyler Hobbs updated CASSANDRA-6950: ----------------------------------- Attachment: 6950-pycassa-repro.py bq. As far as CQL3 goes we could fix it in ExtendedFilter.isSatisfiedBy by check for ReversedType and ignoring it since the IndexExpression are really refering to the non-reverse order, but I guess that would break thrift. Actually, I think that would *fix* thrift, because the current behavior could be considered wrong. See the attached script to reproduce the issue, but to summarize, if we create an index on two columns: * indexed: LongType * indexed2: ReversedType(LongType) insert data, then run a query equivalent to {{... WHERE indexed = 1 AND indexed2 < 4}}, you'll get results where indexed2 > 4. I have to admit that it's a little confusing as to whether using ReversedType on indexed2 should invert the comparison, but I feel like ReversedType should only really affect the storage format and not value comparisons. In any case, it doesn't really make sense to use ReversedType on a column validator, so this is unlikely to affect anybody in practice. So, unless I'm missing another Thrift case that this could affect, I would just make your suggested fix in {{ExtendedFilter.isSatisfiedBy}}. > Secondary index query fails with tc range query when ordered by DESC > -------------------------------------------------------------------- > > Key: CASSANDRA-6950 > URL: https://issues.apache.org/jira/browse/CASSANDRA-6950 > Project: Cassandra > Issue Type: Bug > Components: Core > Environment: RHEL 6.3 virtual guest, > apache-cassandra-2.0.6-SNAPSHOT-src.tar.gz from build #284 (also tried with > 2.0.5 with CASSANDRA-6666 patch custom-applied with same result). > Reporter: Andre Campeau > Assignee: Sylvain Lebresne > Fix For: 2.0.8 > > Attachments: 6950-pycassa-repro.py, 6950.txt > > > create table test4 ( name text, lname text, tc bigint, record text, > PRIMARY KEY ((name, lname), tc)) WITH CLUSTERING ORDER BY (tc DESC) AND > compaction={'class': 'LeveledCompactionStrategy'}; > create index test4_index ON test4(lname); > Populate it with some data and non-zero tc values, then try: > select * from test4 where lname='blah' and tc>0 allow filtering; > And, (0 rows) returned, even though there are rows which should be found. > When I create the table using CLUSTERING ORDER BY (tc ASC), the above query > works. Rows are correctly returned based on the range check. > Tried various combinations but with descending order on tc nothing works. -- This message was sent by Atlassian JIRA (v6.2#6252)