You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Dmitry Petrashko (Created) (JIRA)" <ji...@apache.org> on 2012/03/04 11:34:01 UTC

[jira] [Created] (CASSANDRA-3994) Allow multiple indexes and indexes for comparisons other than equal

Allow multiple indexes and indexes for comparisons other than equal
-------------------------------------------------------------------

                 Key: CASSANDRA-3994
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3994
             Project: Cassandra
          Issue Type: Improvement
          Components: Core
            Reporter: Dmitry Petrashko


As for now, validation marks filters with operations other than equal as invalid.
This is also gives initial support for indexes other than KEYS

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3994) Allow indexes for comparisons other than equal

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

Dmitry Petrashko updated CASSANDRA-3994:
----------------------------------------

    Attachment: Validation_fix_for_filters_other_than_EQuals-v2.patch

git diff output
                
> Allow indexes for comparisons other than equal
> ----------------------------------------------
>
>                 Key: CASSANDRA-3994
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3994
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Dmitry Petrashko
>         Attachments: Validation_fix_for_filters_other_than_EQuals-v2.patch, Validation_fix_for_filters_other_than_EQuals.patch
>
>
> As for now, validation marks filters with operations other than equal as invalid.
> This is also gives initial support for indexes other than KEYS

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3994) Allow indexes for comparisons other than equal

Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13223547#comment-13223547 ] 

Jonathan Ellis commented on CASSANDRA-3994:
-------------------------------------------

That sounds like a reasonable goal.

The patch does not apply -- it is mostly one 35KB line with literal {{\n}} sequences thrown in -- that is, not newlines, but backslash+N.
                
> Allow indexes for comparisons other than equal
> ----------------------------------------------
>
>                 Key: CASSANDRA-3994
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3994
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Dmitry Petrashko
>         Attachments: Validation_fix_for_filters_other_than_EQuals.patch
>
>
> As for now, validation marks filters with operations other than equal as invalid.
> This is also gives initial support for indexes other than KEYS

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (CASSANDRA-3994) Allow indexes for comparisons other than equal

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

Dmitry Petrashko reopened CASSANDRA-3994:
-----------------------------------------

    
> Allow indexes for comparisons other than equal
> ----------------------------------------------
>
>                 Key: CASSANDRA-3994
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3994
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Dmitry Petrashko
>         Attachments: Validation_fix_for_filters_other_than_EQuals.patch
>
>
> As for now, validation marks filters with operations other than equal as invalid.
> This is also gives initial support for indexes other than KEYS

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3994) Allow indexes for comparisons other than equal

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

Dmitry Petrashko updated CASSANDRA-3994:
----------------------------------------

    Summary: Allow indexes for comparisons other than equal  (was: Allow multiple indexes and indexes for comparisons other than equal)
    
> Allow indexes for comparisons other than equal
> ----------------------------------------------
>
>                 Key: CASSANDRA-3994
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3994
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Dmitry Petrashko
>
> As for now, validation marks filters with operations other than equal as invalid.
> This is also gives initial support for indexes other than KEYS

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CASSANDRA-3994) Allow indexes for comparisons other than equal

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

Jonathan Ellis resolved CASSANDRA-3994.
---------------------------------------

    Resolution: Duplicate

Applying filters to seq scan was done in CASSANDRA-1600.
                
> Allow indexes for comparisons other than equal
> ----------------------------------------------
>
>                 Key: CASSANDRA-3994
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3994
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Dmitry Petrashko
>         Attachments: Validation_fix_for_filters_other_than_EQuals.patch
>
>
> As for now, validation marks filters with operations other than equal as invalid.
> This is also gives initial support for indexes other than KEYS

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (CASSANDRA-3994) Allow indexes for comparisons other than equal

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

Dmitry Petrashko reopened CASSANDRA-3994:
-----------------------------------------

    
> Allow indexes for comparisons other than equal
> ----------------------------------------------
>
>                 Key: CASSANDRA-3994
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3994
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Dmitry Petrashko
>         Attachments: Validation_fix_for_filters_other_than_EQuals-v2.patch, Validation_fix_for_filters_other_than_EQuals.patch
>
>
> As for now, validation marks filters with operations other than equal as invalid.
> This is also gives initial support for indexes other than KEYS

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-3994) Allow indexes for comparisons other than equal

Posted by "Dmitry Petrashko (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13222269#comment-13222269 ] 

Dmitry Petrashko edited comment on CASSANDRA-3994 at 3/5/12 11:04 AM:
----------------------------------------------------------------------

As of current trunk, get_range_slices uses  ThriftValidation.validateKeyRange that uses validateFilterClauses.
It requires at least one EQ operation, especially it goes thought expressions applying
isIndexed |= (expression.op == IndexOperator.EQ) && indexedColumns.contains(expression.column_name);

Thus it requires at least one EQ operation. And marks requests with filters containing only > < comparisons on columns as invalid.

Currently we've developed index that can efficiently work with LT GT operations, this patch provides support for requests with filters that use index on operations other than equals.
                
      was (Author: darkdimius):
    Yes, but it allows only equals filter.
It uses ThriftValidation.validateFilterClauses that requires at least one EQ operation
isIndexed |= (expression.op == IndexOperator.EQ) && indexedColumns.contains(expression.column_name);

Currently we've developed index that can efficiently work with LT GT operations, this patch provides support for requests with filters that use index on operations other than equals.
                  
> Allow indexes for comparisons other than equal
> ----------------------------------------------
>
>                 Key: CASSANDRA-3994
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3994
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Dmitry Petrashko
>         Attachments: Validation_fix_for_filters_other_than_EQuals.patch
>
>
> As for now, validation marks filters with operations other than equal as invalid.
> This is also gives initial support for indexes other than KEYS

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CASSANDRA-3994) Allow indexes for comparisons other than equal

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

Jonathan Ellis resolved CASSANDRA-3994.
---------------------------------------

    Resolution: Not A Problem
    
> Allow indexes for comparisons other than equal
> ----------------------------------------------
>
>                 Key: CASSANDRA-3994
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3994
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Dmitry Petrashko
>         Attachments: Validation_fix_for_filters_other_than_EQuals-v2.patch, Validation_fix_for_filters_other_than_EQuals.patch
>
>
> As for now, validation marks filters with operations other than equal as invalid.
> This is also gives initial support for indexes other than KEYS

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3994) Allow indexes for comparisons other than equal

Posted by "Dmitry Petrashko (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13222269#comment-13222269 ] 

Dmitry Petrashko commented on CASSANDRA-3994:
---------------------------------------------

Yes, but it allows only equals filter.
It uses ThriftValidation.validateFilterClauses that requires at least one EQ operation
isIndexed |= (expression.op == IndexOperator.EQ) && indexedColumns.contains(expression.column_name);

Currently we've developed index that can efficiently work with LT GT operations, this patch provides support for requests with filters that use index on operations other than equals.
                
> Allow indexes for comparisons other than equal
> ----------------------------------------------
>
>                 Key: CASSANDRA-3994
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3994
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Dmitry Petrashko
>         Attachments: Validation_fix_for_filters_other_than_EQuals.patch
>
>
> As for now, validation marks filters with operations other than equal as invalid.
> This is also gives initial support for indexes other than KEYS

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3994) Allow indexes for comparisons other than equal

Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13227845#comment-13227845 ] 

Jonathan Ellis commented on CASSANDRA-3994:
-------------------------------------------

We want to preserve the check for KEYS indexes and only relax it for others.

Actually I think the right thing to do is to leave [the deprecated] get_indexed_slices alone, and use get_ranged_slices instead (which allows for index expressions that don't include EQ already).
                
> Allow indexes for comparisons other than equal
> ----------------------------------------------
>
>                 Key: CASSANDRA-3994
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3994
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Dmitry Petrashko
>         Attachments: Validation_fix_for_filters_other_than_EQuals-v2.patch, Validation_fix_for_filters_other_than_EQuals.patch
>
>
> As for now, validation marks filters with operations other than equal as invalid.
> This is also gives initial support for indexes other than KEYS

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CASSANDRA-3994) Allow indexes for comparisons other than equal

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

Jonathan Ellis resolved CASSANDRA-3994.
---------------------------------------

    Resolution: Not A Problem

bq. ThriftValidation.validateKeyRange uses ThriftValidation.validateFilterClauses (Line 507) to validate range.row_filter

But that call ignores the return value, which is what says "this filter involves an indexed column with an EQ clause."  The return value is only checked for the path used by get_indexed_slices, as I said.  For get_range_slices we only make use of validateFilterClause to make sure that the column names and values are appropriate for their declared types.

                
> Allow indexes for comparisons other than equal
> ----------------------------------------------
>
>                 Key: CASSANDRA-3994
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3994
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Dmitry Petrashko
>         Attachments: Validation_fix_for_filters_other_than_EQuals-v2.patch, Validation_fix_for_filters_other_than_EQuals.patch
>
>
> As for now, validation marks filters with operations other than equal as invalid.
> This is also gives initial support for indexes other than KEYS

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3994) Allow indexes for comparisons other than equal

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

Dmitry Petrashko updated CASSANDRA-3994:
----------------------------------------

    Attachment: Validation_fix_for_filters_other_than_EQuals.patch

Fix
Created in wikimart.ru
                
> Allow indexes for comparisons other than equal
> ----------------------------------------------
>
>                 Key: CASSANDRA-3994
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3994
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Dmitry Petrashko
>         Attachments: Validation_fix_for_filters_other_than_EQuals.patch
>
>
> As for now, validation marks filters with operations other than equal as invalid.
> This is also gives initial support for indexes other than KEYS

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3994) Allow indexes for comparisons other than equal

Posted by "Dmitry Petrashko (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232490#comment-13232490 ] 

Dmitry Petrashko commented on CASSANDRA-3994:
---------------------------------------------

Please recheck it one more time.
I never mentioned that this patch is modifying get_indexed_slices.
As of current trunk get_ranged_slices uses 
ThriftValidation.validateKeyRange to validate key range in request
ThriftValidation.validateKeyRange uses ThriftValidation.validateFilterClauses (Line 507) to validate range.row_filter

And there it is checked that at least one (expression.op != null) && indexedColumns.contains(expression.column_name);
Thus current trunk Doesnt allow queries with filters not containing EQ operations on indexed columns.

This patch modifies validation of request in get_ranged_slices to allow requests with filters that use indexes on operations other than EQ.
                
> Allow indexes for comparisons other than equal
> ----------------------------------------------
>
>                 Key: CASSANDRA-3994
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3994
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Dmitry Petrashko
>         Attachments: Validation_fix_for_filters_other_than_EQuals-v2.patch, Validation_fix_for_filters_other_than_EQuals.patch
>
>
> As for now, validation marks filters with operations other than equal as invalid.
> This is also gives initial support for indexes other than KEYS

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira