You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "T Jake Luciani (JIRA)" <ji...@apache.org> on 2012/09/25 17:01:08 UTC

[jira] [Created] (CASSANDRA-4716) CQL3 predicate logic is reversed when used on a reversed column

T Jake Luciani created CASSANDRA-4716:
-----------------------------------------

             Summary: CQL3 predicate logic is reversed when used on a reversed column
                 Key: CASSANDRA-4716
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4716
             Project: Cassandra
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.1.0
            Reporter: T Jake Luciani
             Fix For: 1.1.6


Example:

{code}
cqlsh:test>
cqlsh:test> CREATE TABLE testrev (
        ... key text,
        ... rdate timestamp,
        ... num double,
        ... PRIMARY KEY(key,rdate)
        ... ) WITH COMPACT STORAGE
        ...   AND CLUSTERING ORDER BY(rdate DESC);
cqlsh:test> INSERT INTO testrev(key,rdate,num) VALUES ('foo','2012-01-01',10.5);
cqlsh:test> select key from testrev where rdate > '2012-01-02' ;
 key 
-----
 foo 

cqlsh:test> select key from testrev where rdate < '2012-01-02' ;
cqlsh:test>
{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

[jira] [Assigned] (CASSANDRA-4716) CQL3 predicate logic is reversed when used on a reversed column

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4716?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Lebresne reassigned CASSANDRA-4716:
-------------------------------------------

    Assignee: Sylvain Lebresne
    
> CQL3 predicate logic is reversed when used on a reversed column
> ---------------------------------------------------------------
>
>                 Key: CASSANDRA-4716
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4716
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.0
>            Reporter: T Jake Luciani
>            Assignee: Sylvain Lebresne
>             Fix For: 1.1.6
>
>
> Example:
> {code}
> cqlsh:test>
> cqlsh:test> CREATE TABLE testrev (
>         ... key text,
>         ... rdate timestamp,
>         ... num double,
>         ... PRIMARY KEY(key,rdate)
>         ... ) WITH COMPACT STORAGE
>         ...   AND CLUSTERING ORDER BY(rdate DESC);
> cqlsh:test> INSERT INTO testrev(key,rdate,num) VALUES ('foo','2012-01-01',10.5);
> cqlsh:test> select key from testrev where rdate > '2012-01-02' ;
>  key 
> -----
>  foo 
> cqlsh:test> select key from testrev where rdate < '2012-01-02' ;
> cqlsh:test>
> {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

[jira] [Commented] (CASSANDRA-4716) CQL3 predicate logic is reversed when used on a reversed column

Posted by "T Jake Luciani (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13467834#comment-13467834 ] 

T Jake Luciani commented on CASSANDRA-4716:
-------------------------------------------

+1
                
> CQL3 predicate logic is reversed when used on a reversed column
> ---------------------------------------------------------------
>
>                 Key: CASSANDRA-4716
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4716
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.0
>            Reporter: T Jake Luciani
>            Assignee: Sylvain Lebresne
>             Fix For: 1.1.6
>
>         Attachments: 4716.txt
>
>
> Example:
> {code}
> cqlsh:test>
> cqlsh:test> CREATE TABLE testrev (
>         ... key text,
>         ... rdate timestamp,
>         ... num double,
>         ... PRIMARY KEY(key,rdate)
>         ... ) WITH COMPACT STORAGE
>         ...   AND CLUSTERING ORDER BY(rdate DESC);
> cqlsh:test> INSERT INTO testrev(key,rdate,num) VALUES ('foo','2012-01-01',10.5);
> cqlsh:test> select key from testrev where rdate > '2012-01-02' ;
>  key 
> -----
>  foo 
> cqlsh:test> select key from testrev where rdate < '2012-01-02' ;
> cqlsh:test>
> {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

[jira] [Updated] (CASSANDRA-4716) CQL3 predicate logic is reversed when used on a reversed column

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4716?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Lebresne updated CASSANDRA-4716:
----------------------------------------

    Attachment: 4716.txt

This can't be fixed in the parser as this all depends on what's the clustering order and the requested order (if any).

But attaching a patch to fix this (I've pushed dtests to make sure we're good with different variation of clustering order/order by). 
                
> CQL3 predicate logic is reversed when used on a reversed column
> ---------------------------------------------------------------
>
>                 Key: CASSANDRA-4716
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4716
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.0
>            Reporter: T Jake Luciani
>            Assignee: Sylvain Lebresne
>             Fix For: 1.1.6
>
>         Attachments: 4716.txt
>
>
> Example:
> {code}
> cqlsh:test>
> cqlsh:test> CREATE TABLE testrev (
>         ... key text,
>         ... rdate timestamp,
>         ... num double,
>         ... PRIMARY KEY(key,rdate)
>         ... ) WITH COMPACT STORAGE
>         ...   AND CLUSTERING ORDER BY(rdate DESC);
> cqlsh:test> INSERT INTO testrev(key,rdate,num) VALUES ('foo','2012-01-01',10.5);
> cqlsh:test> select key from testrev where rdate > '2012-01-02' ;
>  key 
> -----
>  foo 
> cqlsh:test> select key from testrev where rdate < '2012-01-02' ;
> cqlsh:test>
> {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

[jira] [Commented] (CASSANDRA-4716) CQL3 predicate logic is reversed when used on a reversed column

Posted by "T Jake Luciani (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13467134#comment-13467134 ] 

T Jake Luciani commented on CASSANDRA-4716:
-------------------------------------------

How deeply do we want to fix this? It goes pretty deep into how we deal with isReversed flag vs ReversedType.

We can, however easily fix it in the CQLParser by just flipping the predicates signs around.
                
> CQL3 predicate logic is reversed when used on a reversed column
> ---------------------------------------------------------------
>
>                 Key: CASSANDRA-4716
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4716
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.0
>            Reporter: T Jake Luciani
>            Assignee: Sylvain Lebresne
>             Fix For: 1.1.6
>
>
> Example:
> {code}
> cqlsh:test>
> cqlsh:test> CREATE TABLE testrev (
>         ... key text,
>         ... rdate timestamp,
>         ... num double,
>         ... PRIMARY KEY(key,rdate)
>         ... ) WITH COMPACT STORAGE
>         ...   AND CLUSTERING ORDER BY(rdate DESC);
> cqlsh:test> INSERT INTO testrev(key,rdate,num) VALUES ('foo','2012-01-01',10.5);
> cqlsh:test> select key from testrev where rdate > '2012-01-02' ;
>  key 
> -----
>  foo 
> cqlsh:test> select key from testrev where rdate < '2012-01-02' ;
> cqlsh:test>
> {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