You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sylvain Lebresne (JIRA)" <ji...@apache.org> on 2013/01/03 19:34:13 UTC

[jira] [Commented] (CASSANDRA-4762) Support multiple OR clauses for CQL3 Compact storage

    [ https://issues.apache.org/jira/browse/CASSANDRA-4762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13543168#comment-13543168 ] 

Sylvain Lebresne commented on CASSANDRA-4762:
---------------------------------------------

I'm conflicted about those addMany and buildMany in ColumnNameBuilder. It feels very easy to misuse by say using addMany and later along the road using build instead of buildMany. It feels like it breaks the abstraction that ColumnNameBuilder builds one column name.

An option would be to just change ColumnNameBuilder to ColumnName*s*Builder and just have build always return a list, but that could be annoying in other places where we really just want to create one column name. A maybe better option might be to just create a separate class to build multiple names at once and use that when that make sense. It might duplicate a bit of code but I feel that it would be cleaner overall.

On the rest of the patch:
* This doesn't work if the query is reversed because addMany sorts in comparator order, but if the query is reversed, the ColumnSlices should be reversed too.
* Queries by names are not handled. In other words SelectStatement.getRequestedColumns needs to be updated too otherwise queries where all components of the PK have an EQ or IN don't work correctly.
* We should remove the validation restrict IN to compact CF (since this ticket exactly adds what's needed to remove that limitation)

                
> Support multiple OR clauses for CQL3 Compact storage
> ----------------------------------------------------
>
>                 Key: CASSANDRA-4762
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4762
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: T Jake Luciani
>            Assignee: T Jake Luciani
>              Labels: cql3
>             Fix For: 1.2.1
>
>         Attachments: 4762-1.txt
>
>
> Given CASSANDRA-3885
> It seems it should be possible to store multiple ranges for many predicates even the inner parts of a composite column.
> They could be expressed as a expanded set of filter queries.
> example:
> {code}
> CREATE TABLE test (
>        name text,
>        tdate timestamp,
>        tdate2 timestamp,
>        tdate3 timestamp,
>        num double,
>        PRIMARY KEY(name,tdate,tdate2,tdate3)
>      ) WITH COMPACT STORAGE;
> SELECT * FROM test WHERE 
>   name IN ('a','b') and
>   tdate IN ('2010-01-01','2011-01-01') and
>   tdate2 IN ('2010-01-01','2011-01-01') and
>   tdate3 IN ('2010-01-01','2011-01-01') 
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira