cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Petrov (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CASSANDRA-11310) Allow filtering on clustering columns for queries without secondary indexes
Date Mon, 21 Mar 2016 11:10:25 GMT

    [ 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)

Mime
View raw message