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 01A4418DBB for ; Mon, 21 Mar 2016 11:10:26 +0000 (UTC) Received: (qmail 83600 invoked by uid 500); 21 Mar 2016 11:10:25 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 83574 invoked by uid 500); 21 Mar 2016 11:10:25 -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 83563 invoked by uid 99); 21 Mar 2016 11:10:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Mar 2016 11:10:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 8063C2C1F64 for ; Mon, 21 Mar 2016 11:10:25 +0000 (UTC) Date: Mon, 21 Mar 2016 11:10:25 +0000 (UTC) From: "Alex Petrov (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CASSANDRA-11310) Allow filtering on clustering columns for queries without secondary indexes 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-11310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15202782#comment-15202782 ] Alex Petrov edited comment on CASSANDRA-11310 at 3/21/16 11:10 AM: ------------------------------------------------------------------- I've tried to get it all sorted out and have handled most of the things by now, although some cases are harder to handle without larger changes. For example, within the {{StatementRestrictions}} we can't know whether there {{ClusteringColumnRestrictions}} would require filtering. One of the cases is multiple column slices, when clustering columns are given in the correct order. Without seeing actual restrictions (which are private to the {{PrimaryKeyRestrictionSet}}), we can't assert that there is more than one slice. For example, there's a custom logic related to filtering contained within in the {{RestrictionSet}}, such as {{hasMultipleContains}}. I think it will be simpler to handle on top of your branch: https://github.com/blerer/cassandra/commits/11354-trunk, since there it's going to be possible to add logic related to the clustering columns within the clustering columns class. To give a bit of background, I've consolidated {{usesFiltering}} and exposed it via (previously existed) {{StatementRestrictions::needFiltering}}, and made sure that both {{usesFiltering}} and {{usesSecondaryIndexing}} are correctly and consistently set. For the last bit, it'd be good to know whether clustering column restrictions require filtering, as described above. Do you think it's a good idea? was (Author: ifesdjeen): I've tried to get it all sorted out and have handled most of the things by now, although some cases are harder to handle without larger changes. For example, within the {{StatementRestrictions}} we can't know whether there {{ClusteringColumnRestrictions}} would require filtering. One of the cases is multiple column slices, when clustering columns are given in the correct order. Without seeing actual restrictions (which are private to the {{PrimaryKeyRestrictionSet}}), we can't assert that there is more than one slice. For example, there's a custom logic related to filtering contained within in the {{RestrictionSet}}, such as {{hasMultipleContains}}. I think it will be simpler to handle on top of your branch: https://github.com/blerer/cassandra/commits/11354-trunk, since there it's going to be possible to add logic related to the clustering columns within the clustering columns class. Do you think it's a good idea? > Allow filtering on clustering columns for queries without secondary indexes > --------------------------------------------------------------------------- > > Key: CASSANDRA-11310 > URL: https://issues.apache.org/jira/browse/CASSANDRA-11310 > Project: Cassandra > Issue Type: Improvement > Components: CQL > Reporter: Benjamin Lerer > Assignee: Alex Petrov > Labels: doc-impacting > Fix For: 3.x > > > Since CASSANDRA-6377 queries without index filtering non-primary key columns are fully supported. > It makes sense to also support filtering on clustering-columns. > {code} > CREATE TABLE emp_table2 ( > empID int, > firstname text, > lastname text, > b_mon text, > b_day text, > b_yr text, > PRIMARY KEY (empID, b_yr, b_mon, b_day)); > SELECT b_mon,b_day,b_yr,firstname,lastname FROM emp_table2 > WHERE b_mon='oct' ALLOW FILTERING; > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)