You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sandeep Tata (JIRA)" <ji...@apache.org> on 2009/04/15 00:56:14 UTC

[jira] Created: (CASSANDRA-81) get_slice ignores the "start" parameter

get_slice ignores the "start" parameter
---------------------------------------

                 Key: CASSANDRA-81
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-81
             Project: Cassandra
          Issue Type: Bug
    Affects Versions: trunk
         Environment: all
            Reporter: Sandeep Tata
            Assignee: Sandeep Tata
             Fix For: trunk


get_slice(string tablename, string key, string columnFamily_column, i32 start, i32 count) is expected is return all columns starting at offset "start" subject to a maximum of "count" columns. The current code does not do this.
Example interaction:

./Cassandra-remote insert 'Table1' 'key' 'DATA:c1' 'val1' 1
None
./Cassandra-remote insert 'Table1' 'key' 'DATA:c2' 'val2' 1
None
./Cassandra-remote insert 'Table1' 'key' 'DATA:c3' 'val3' 1
None

./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  0 2

[ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
  {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]

./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  1 2

[ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
  {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]]  <<---- Same as prev! "start" ignored

./Cassandra-remote  get_slice 'Table1' 'key' 'DATA'  0 1
[{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]

./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  2 1
[{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]    <<---- Same as prev! "start" ignored






-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-81) get_slice ignores the "start" parameter

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

Sandeep Tata updated CASSANDRA-81:
----------------------------------

    Attachment: CASSANDRA-81-v6.patch

Remade patch after #85.


> 2. values.length == 1 is _not_ the same as !isSuper(). You could be slicing supercolumns of a super CF, or you could be slicing normal columns of a standard CF. (This is an easy mistake to make because the API is designed poorly. But fixing that is a job for 0.4 I think.) 

Good catch. Fixed. 

I don't like that getColumnCount returns 1+number of subcolumns for supercolumns. That is, cf.getAllColumns.size() is not equal to cf.getColumnCount. If at some point we decide to change this, we'll have to fix these unit tests.

> get_slice ignores the "start" parameter
> ---------------------------------------
>
>                 Key: CASSANDRA-81
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-81
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: trunk
>         Environment: all
>            Reporter: Sandeep Tata
>            Assignee: Sandeep Tata
>             Fix For: 0.3
>
>         Attachments: 81-v5.patch, CASSANDRA-81-v6.patch, fix_for_get_slice.patch, get_slice_fix_and_unit_tests_v2.patch, get_slice_fix_and_unit_tests_v3.patch, get_slice_fix_and_unit_tests_v4.patch, unit_tests_for_get_slice.patch
>
>
> get_slice(string tablename, string key, string columnFamily_column, i32 start, i32 count) is expected is return all columns starting at offset "start" subject to a maximum of "count" columns. The current code does not do this.
> Example interaction:
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c1' 'val1' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c2' 'val2' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c3' 'val3' 1
> None
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  0 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  1 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]]  <<---- Same as prev! "start" ignored
> ./Cassandra-remote  get_slice 'Table1' 'key' 'DATA'  0 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  2 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]    <<---- Same as prev! "start" ignored

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-81) get_slice ignores the "start" parameter

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

Sandeep Tata updated CASSANDRA-81:
----------------------------------

    Attachment: CASSANDRA-81-v7.patch

1. fixed test.
2. inlined filter :-)

> get_slice ignores the "start" parameter
> ---------------------------------------
>
>                 Key: CASSANDRA-81
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-81
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: trunk
>         Environment: all
>            Reporter: Sandeep Tata
>            Assignee: Sandeep Tata
>             Fix For: 0.3
>
>         Attachments: 81-v5.patch, CASSANDRA-81-v6.patch, CASSANDRA-81-v7.patch, fix_for_get_slice.patch, get_slice_fix_and_unit_tests_v2.patch, get_slice_fix_and_unit_tests_v3.patch, get_slice_fix_and_unit_tests_v4.patch, unit_tests_for_get_slice.patch
>
>
> get_slice(string tablename, string key, string columnFamily_column, i32 start, i32 count) is expected is return all columns starting at offset "start" subject to a maximum of "count" columns. The current code does not do this.
> Example interaction:
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c1' 'val1' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c2' 'val2' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c3' 'val3' 1
> None
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  0 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  1 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]]  <<---- Same as prev! "start" ignored
> ./Cassandra-remote  get_slice 'Table1' 'key' 'DATA'  0 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  2 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]    <<---- Same as prev! "start" ignored

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-81) get_slice ignores the "start" parameter

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

Sandeep Tata updated CASSANDRA-81:
----------------------------------

    Attachment: unit_tests_for_get_slice.patch

Added unit tests that produce errors for get_slice when
a) called with nonzero start
b) when data needs to be fetched from ssTables and Memtable

> get_slice ignores the "start" parameter
> ---------------------------------------
>
>                 Key: CASSANDRA-81
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-81
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: trunk
>         Environment: all
>            Reporter: Sandeep Tata
>            Assignee: Sandeep Tata
>             Fix For: trunk
>
>         Attachments: unit_tests_for_get_slice.patch
>
>
> get_slice(string tablename, string key, string columnFamily_column, i32 start, i32 count) is expected is return all columns starting at offset "start" subject to a maximum of "count" columns. The current code does not do this.
> Example interaction:
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c1' 'val1' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c2' 'val2' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c3' 'val3' 1
> None
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  0 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  1 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]]  <<---- Same as prev! "start" ignored
> ./Cassandra-remote  get_slice 'Table1' 'key' 'DATA'  0 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  2 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]    <<---- Same as prev! "start" ignored

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-81) get_slice ignores the "start" parameter

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

Jonathan Ellis commented on CASSANDRA-81:
-----------------------------------------

                if (count == Integer.MAX_VALUE && start == 0) //Don't need to filter

this test needs to be modified a bit since the defaults are -1, -1.  I scanned the rest of the code and I think the other tests on count and start are ok, can you doublecheck that?

                    IFilter filter = new CountFilter(count, start);
                    filteredCf = filter.filter(cf, columnFamily);

style nit: can we inline the filter creation?


> get_slice ignores the "start" parameter
> ---------------------------------------
>
>                 Key: CASSANDRA-81
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-81
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: trunk
>         Environment: all
>            Reporter: Sandeep Tata
>            Assignee: Sandeep Tata
>             Fix For: 0.3
>
>         Attachments: 81-v5.patch, CASSANDRA-81-v6.patch, fix_for_get_slice.patch, get_slice_fix_and_unit_tests_v2.patch, get_slice_fix_and_unit_tests_v3.patch, get_slice_fix_and_unit_tests_v4.patch, unit_tests_for_get_slice.patch
>
>
> get_slice(string tablename, string key, string columnFamily_column, i32 start, i32 count) is expected is return all columns starting at offset "start" subject to a maximum of "count" columns. The current code does not do this.
> Example interaction:
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c1' 'val1' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c2' 'val2' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c3' 'val3' 1
> None
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  0 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  1 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]]  <<---- Same as prev! "start" ignored
> ./Cassandra-remote  get_slice 'Table1' 'key' 'DATA'  0 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  2 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]    <<---- Same as prev! "start" ignored

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-81) get_slice ignores the "start" parameter

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

Jonathan Ellis commented on CASSANDRA-81:
-----------------------------------------

hmm, patch does not apply cleanly against trunk for me.  which is weird since CountFilter hasn't been touched in a while.  Can you try regenerating after svn up just to be sure?

> get_slice ignores the "start" parameter
> ---------------------------------------
>
>                 Key: CASSANDRA-81
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-81
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: trunk
>         Environment: all
>            Reporter: Sandeep Tata
>            Assignee: Sandeep Tata
>             Fix For: 0.3
>
>         Attachments: fix_for_get_slice.patch, get_slice_fix_and_unit_tests_v2.patch, get_slice_fix_and_unit_tests_v3.patch, unit_tests_for_get_slice.patch
>
>
> get_slice(string tablename, string key, string columnFamily_column, i32 start, i32 count) is expected is return all columns starting at offset "start" subject to a maximum of "count" columns. The current code does not do this.
> Example interaction:
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c1' 'val1' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c2' 'val2' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c3' 'val3' 1
> None
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  0 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  1 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]]  <<---- Same as prev! "start" ignored
> ./Cassandra-remote  get_slice 'Table1' 'key' 'DATA'  0 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  2 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]    <<---- Same as prev! "start" ignored

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-81) get_slice ignores the "start" parameter

Posted by "Sandeep Tata (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-81?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699039#action_12699039 ] 

Sandeep Tata commented on CASSANDRA-81:
---------------------------------------

The current patch only tests this with columns -- we'll need some tests for super columns next.

> get_slice ignores the "start" parameter
> ---------------------------------------
>
>                 Key: CASSANDRA-81
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-81
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: trunk
>         Environment: all
>            Reporter: Sandeep Tata
>            Assignee: Sandeep Tata
>             Fix For: trunk
>
>         Attachments: fix_for_get_slice.patch, unit_tests_for_get_slice.patch
>
>
> get_slice(string tablename, string key, string columnFamily_column, i32 start, i32 count) is expected is return all columns starting at offset "start" subject to a maximum of "count" columns. The current code does not do this.
> Example interaction:
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c1' 'val1' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c2' 'val2' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c3' 'val3' 1
> None
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  0 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  1 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]]  <<---- Same as prev! "start" ignored
> ./Cassandra-remote  get_slice 'Table1' 'key' 'DATA'  0 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  2 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]    <<---- Same as prev! "start" ignored

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-81) get_slice ignores the "start" parameter

Posted by "Sandeep Tata (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-81?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699837#action_12699837 ] 

Sandeep Tata commented on CASSANDRA-81:
---------------------------------------

Makes sense. I'll finish reviewing 85, and then redo this patch.

> get_slice ignores the "start" parameter
> ---------------------------------------
>
>                 Key: CASSANDRA-81
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-81
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: trunk
>         Environment: all
>            Reporter: Sandeep Tata
>            Assignee: Sandeep Tata
>             Fix For: 0.3
>
>         Attachments: 81-v5.patch, fix_for_get_slice.patch, get_slice_fix_and_unit_tests_v2.patch, get_slice_fix_and_unit_tests_v3.patch, get_slice_fix_and_unit_tests_v4.patch, unit_tests_for_get_slice.patch
>
>
> get_slice(string tablename, string key, string columnFamily_column, i32 start, i32 count) is expected is return all columns starting at offset "start" subject to a maximum of "count" columns. The current code does not do this.
> Example interaction:
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c1' 'val1' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c2' 'val2' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c3' 'val3' 1
> None
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  0 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  1 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]]  <<---- Same as prev! "start" ignored
> ./Cassandra-remote  get_slice 'Table1' 'key' 'DATA'  0 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  2 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]    <<---- Same as prev! "start" ignored

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-81) get_slice ignores the "start" parameter

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

Sandeep Tata updated CASSANDRA-81:
----------------------------------

    Attachment: get_slice_fix_and_unit_tests_v3.patch

Changes with v3:

1. Added supercolumn tests
2. Moved the filtering code into CountFilter and called it from Table
3. Added call to waitForFlush 

> get_slice ignores the "start" parameter
> ---------------------------------------
>
>                 Key: CASSANDRA-81
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-81
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: trunk
>         Environment: all
>            Reporter: Sandeep Tata
>            Assignee: Sandeep Tata
>             Fix For: 0.3
>
>         Attachments: fix_for_get_slice.patch, get_slice_fix_and_unit_tests_v2.patch, get_slice_fix_and_unit_tests_v3.patch, unit_tests_for_get_slice.patch
>
>
> get_slice(string tablename, string key, string columnFamily_column, i32 start, i32 count) is expected is return all columns starting at offset "start" subject to a maximum of "count" columns. The current code does not do this.
> Example interaction:
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c1' 'val1' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c2' 'val2' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c3' 'val3' 1
> None
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  0 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  1 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]]  <<---- Same as prev! "start" ignored
> ./Cassandra-remote  get_slice 'Table1' 'key' 'DATA'  0 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  2 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]    <<---- Same as prev! "start" ignored

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-81) get_slice ignores the "start" parameter

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

Jonathan Ellis updated CASSANDRA-81:
------------------------------------

    Fix Version/s:     (was: trunk)
                   0.3

> get_slice ignores the "start" parameter
> ---------------------------------------
>
>                 Key: CASSANDRA-81
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-81
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: trunk
>         Environment: all
>            Reporter: Sandeep Tata
>            Assignee: Sandeep Tata
>             Fix For: 0.3
>
>         Attachments: fix_for_get_slice.patch, get_slice_fix_and_unit_tests_v2.patch, unit_tests_for_get_slice.patch
>
>
> get_slice(string tablename, string key, string columnFamily_column, i32 start, i32 count) is expected is return all columns starting at offset "start" subject to a maximum of "count" columns. The current code does not do this.
> Example interaction:
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c1' 'val1' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c2' 'val2' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c3' 'val3' 1
> None
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  0 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  1 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]]  <<---- Same as prev! "start" ignored
> ./Cassandra-remote  get_slice 'Table1' 'key' 'DATA'  0 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  2 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]    <<---- Same as prev! "start" ignored

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-81) get_slice ignores the "start" parameter

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

Sandeep Tata updated CASSANDRA-81:
----------------------------------

    Attachment: fix_for_get_slice.patch

Basic idea:

Instead of passing in a CountFilter, the getRow call resolves the entire row, drops the first "offset" cols, picks the next "count" cols and returns. For the given semantics, you can't get around resolving the full row.



> get_slice ignores the "start" parameter
> ---------------------------------------
>
>                 Key: CASSANDRA-81
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-81
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: trunk
>         Environment: all
>            Reporter: Sandeep Tata
>            Assignee: Sandeep Tata
>             Fix For: trunk
>
>         Attachments: fix_for_get_slice.patch, unit_tests_for_get_slice.patch
>
>
> get_slice(string tablename, string key, string columnFamily_column, i32 start, i32 count) is expected is return all columns starting at offset "start" subject to a maximum of "count" columns. The current code does not do this.
> Example interaction:
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c1' 'val1' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c2' 'val2' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c3' 'val3' 1
> None
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  0 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  1 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]]  <<---- Same as prev! "start" ignored
> ./Cassandra-remote  get_slice 'Table1' 'key' 'DATA'  0 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  2 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]    <<---- Same as prev! "start" ignored

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-81) get_slice ignores the "start" parameter

Posted by "Sandeep Tata (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-81?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699032#action_12699032 ] 

Sandeep Tata commented on CASSANDRA-81:
---------------------------------------

There's an another, more subtle problem with this bug. Even with start=0, the columns returned are not guaranteed to be in order.

Suppose that you:

write col2
write col3

flush -- the memtable is now empty, the ssTable contains col2 and col3
write col1
write col4
write col5

get_slice(table, colfam, 0, 3):

You should get col1, col2, col3 --> not col1, col4, col5 (from current memtable alone)


> get_slice ignores the "start" parameter
> ---------------------------------------
>
>                 Key: CASSANDRA-81
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-81
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: trunk
>         Environment: all
>            Reporter: Sandeep Tata
>            Assignee: Sandeep Tata
>             Fix For: trunk
>
>
> get_slice(string tablename, string key, string columnFamily_column, i32 start, i32 count) is expected is return all columns starting at offset "start" subject to a maximum of "count" columns. The current code does not do this.
> Example interaction:
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c1' 'val1' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c2' 'val2' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c3' 'val3' 1
> None
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  0 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  1 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]]  <<---- Same as prev! "start" ignored
> ./Cassandra-remote  get_slice 'Table1' 'key' 'DATA'  0 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  2 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]    <<---- Same as prev! "start" ignored

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-81) get_slice ignores the "start" parameter

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

Jonathan Ellis updated CASSANDRA-81:
------------------------------------

    Attachment: 81-v5.patch

I cleaned up a couple things in CountFilter.

1. use this() for constructor overloading instead of pasting code

2. values.length == 1 is _not_ the same as !isSuper().  You could be slicing supercolumns of a super CF, or you could be slicing normal columns of a standard CF.  (This is an easy mistake to make because the API is designed poorly.  But fixing that is a job for 0.4 I think.)

testGetRowSuperColumnOffsetCount errors out b/c of cleanup problems.  When I applied it after CASSANDRA-85 (which improves cleanup considerably), the test fails.  (Possibly my fault for sloppy conflict resolution.)

I suggest we apply 85 first to at least get to a reproducible state in the test.

> get_slice ignores the "start" parameter
> ---------------------------------------
>
>                 Key: CASSANDRA-81
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-81
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: trunk
>         Environment: all
>            Reporter: Sandeep Tata
>            Assignee: Sandeep Tata
>             Fix For: 0.3
>
>         Attachments: 81-v5.patch, fix_for_get_slice.patch, get_slice_fix_and_unit_tests_v2.patch, get_slice_fix_and_unit_tests_v3.patch, get_slice_fix_and_unit_tests_v4.patch, unit_tests_for_get_slice.patch
>
>
> get_slice(string tablename, string key, string columnFamily_column, i32 start, i32 count) is expected is return all columns starting at offset "start" subject to a maximum of "count" columns. The current code does not do this.
> Example interaction:
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c1' 'val1' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c2' 'val2' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c3' 'val3' 1
> None
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  0 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  1 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]]  <<---- Same as prev! "start" ignored
> ./Cassandra-remote  get_slice 'Table1' 'key' 'DATA'  0 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  2 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]    <<---- Same as prev! "start" ignored

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-81) get_slice ignores the "start" parameter

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

Jonathan Ellis commented on CASSANDRA-81:
-----------------------------------------

oh, one more thing -- flush is asynchronous, so you'll want to call waitForFlush like the CFS tests.

> get_slice ignores the "start" parameter
> ---------------------------------------
>
>                 Key: CASSANDRA-81
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-81
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: trunk
>         Environment: all
>            Reporter: Sandeep Tata
>            Assignee: Sandeep Tata
>             Fix For: trunk
>
>         Attachments: fix_for_get_slice.patch, get_slice_fix_and_unit_tests_v2.patch, unit_tests_for_get_slice.patch
>
>
> get_slice(string tablename, string key, string columnFamily_column, i32 start, i32 count) is expected is return all columns starting at offset "start" subject to a maximum of "count" columns. The current code does not do this.
> Example interaction:
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c1' 'val1' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c2' 'val2' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c3' 'val3' 1
> None
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  0 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  1 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]]  <<---- Same as prev! "start" ignored
> ./Cassandra-remote  get_slice 'Table1' 'key' 'DATA'  0 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  2 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]    <<---- Same as prev! "start" ignored

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-81) get_slice ignores the "start" parameter

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

Jonathan Ellis commented on CASSANDRA-81:
-----------------------------------------

functionality patch looks ok.  (but watch bracing -- }else should be two lines to be consistent.  I can fix that up on apply though in this case.)

some comments on the tests --

1. does testGetRowSingleColumn add anything, coverage-wise?  If not, I don't want to maintain it. :)

2. don't catch test exceptions, let them get raised.  that's a lot more informative than assertTrue(False).

3. table.clearSnapshot() is a no-op here, so leave that out.  (if you inherit from ServerTest that will do a slightly better job of cleanup but the code relies too much on static structures for us to do it "right."  so don't worry too much about that.)


> get_slice ignores the "start" parameter
> ---------------------------------------
>
>                 Key: CASSANDRA-81
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-81
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: trunk
>         Environment: all
>            Reporter: Sandeep Tata
>            Assignee: Sandeep Tata
>             Fix For: trunk
>
>         Attachments: fix_for_get_slice.patch, unit_tests_for_get_slice.patch
>
>
> get_slice(string tablename, string key, string columnFamily_column, i32 start, i32 count) is expected is return all columns starting at offset "start" subject to a maximum of "count" columns. The current code does not do this.
> Example interaction:
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c1' 'val1' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c2' 'val2' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c3' 'val3' 1
> None
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  0 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  1 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]]  <<---- Same as prev! "start" ignored
> ./Cassandra-remote  get_slice 'Table1' 'key' 'DATA'  0 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  2 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]    <<---- Same as prev! "start" ignored

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-81) get_slice ignores the "start" parameter

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

Sandeep Tata updated CASSANDRA-81:
----------------------------------

    Attachment: get_slice_fix_and_unit_tests_v2.patch

Thanks for the review. Attached a revised version.

>1. does testGetRowSingleColumn add anything, coverage-wise? If not, I don't want to maintain it. :) 
It isn't much, but It does test one of the simpler getRow calls in Table. 

2. don't catch test exceptions, let them get raised. that's a lot more informative than assertTrue(False). 
Fixed.

>3. table.clearSnapshot() is a no-op here, so leave that out. (if you inherit from ServerTest that will do a slightly better job of cleanup but the code relies too much on static structures for us to do it "right." so don't worry too much about that.) 
Removed. I like the idea of inheriting ServerTest -- I modified TableTest to do that. Everything still passes :-)

> get_slice ignores the "start" parameter
> ---------------------------------------
>
>                 Key: CASSANDRA-81
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-81
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: trunk
>         Environment: all
>            Reporter: Sandeep Tata
>            Assignee: Sandeep Tata
>             Fix For: trunk
>
>         Attachments: fix_for_get_slice.patch, get_slice_fix_and_unit_tests_v2.patch, unit_tests_for_get_slice.patch
>
>
> get_slice(string tablename, string key, string columnFamily_column, i32 start, i32 count) is expected is return all columns starting at offset "start" subject to a maximum of "count" columns. The current code does not do this.
> Example interaction:
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c1' 'val1' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c2' 'val2' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c3' 'val3' 1
> None
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  0 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  1 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]]  <<---- Same as prev! "start" ignored
> ./Cassandra-remote  get_slice 'Table1' 'key' 'DATA'  0 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  2 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]    <<---- Same as prev! "start" ignored

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-81) get_slice ignores the "start" parameter

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

Sandeep Tata updated CASSANDRA-81:
----------------------------------

    Attachment: get_slice_fix_and_unit_tests_v4.patch

Regenerated v4 after an svn up -- there were some changes to ColumnFamilyStoreTest that I hadn't updated to.

> get_slice ignores the "start" parameter
> ---------------------------------------
>
>                 Key: CASSANDRA-81
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-81
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: trunk
>         Environment: all
>            Reporter: Sandeep Tata
>            Assignee: Sandeep Tata
>             Fix For: 0.3
>
>         Attachments: fix_for_get_slice.patch, get_slice_fix_and_unit_tests_v2.patch, get_slice_fix_and_unit_tests_v3.patch, get_slice_fix_and_unit_tests_v4.patch, unit_tests_for_get_slice.patch
>
>
> get_slice(string tablename, string key, string columnFamily_column, i32 start, i32 count) is expected is return all columns starting at offset "start" subject to a maximum of "count" columns. The current code does not do this.
> Example interaction:
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c1' 'val1' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c2' 'val2' 1
> None
> ./Cassandra-remote insert 'Table1' 'key' 'DATA:c3' 'val3' 1
> None
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  0 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  1 2
> [ {'columnName': 'c1', 'value': 'val1', 'timestamp': 1},
>   {'columnName': 'c2', 'value': 'val2', 'timestamp': 1}]]  <<---- Same as prev! "start" ignored
> ./Cassandra-remote  get_slice 'Table1' 'key' 'DATA'  0 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]
> ./Cassandra-remote get_slice 'Table1' 'key' 'DATA'  2 1
> [{'columnName': 'c1', 'value': 'val1', 'timestamp': 1}]    <<---- Same as prev! "start" ignored

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.