Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 34FB511F8D for ; Tue, 6 May 2014 13:24:45 +0000 (UTC) Received: (qmail 39422 invoked by uid 500); 6 May 2014 13:21:18 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 39348 invoked by uid 500); 6 May 2014 13:21:16 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 39269 invoked by uid 99); 6 May 2014 13:21:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 May 2014 13:21:15 +0000 Date: Tue, 6 May 2014 13:21:15 +0000 (UTC) From: "Sylvain Lebresne (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-6950) Secondary index query fails with tc range query when ordered by DESC MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-6950?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sylvain Lebresne updated CASSANDRA-6950: ---------------------------------------- Attachment: 6950.txt The problem is that when the 2ndary code checks if an indexed row satisfies the extra filters (so {{tc>0}} in the example of the description), it does so (in {{ExtendedFilter.isSatisfiedBy}}) using the underlying reverse comparator (so it check if the {{tc}} value is greated than 0 in reverse order, i.e. if {{tc}} is negative basically). 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. So attaching a patch that just reverse the IndexExpression in the first place in SelectStatement. > 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.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)