You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Lex Lythius (JIRA)" <ji...@apache.org> on 2014/11/05 22:41:34 UTC

[jira] [Commented] (CASSANDRA-7588) cqlsh error for query against collection index - list index out of range

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

Lex Lythius commented on CASSANDRA-7588:
----------------------------------------

This still happens in version 2.1.1, CQLSH 5.0.1.
{code}
> SELECT * from uloc8 where info2 CONTAINS KEY 'spd';
Traceback (most recent call last):
  File "/usr/bin/cqlsh", line 861, in onecmd
    self.handle_statement(st, statementtext)
  File "/usr/bin/cqlsh", line 901, in handle_statement
    return self.handle_parse_error(cmdword, tokens, parsed, srcstr)
  File "/usr/bin/cqlsh", line 910, in handle_parse_error
    return self.perform_statement(cqlruleset.cql_extract_orig(tokens, srcstr))
  File "/usr/bin/cqlsh", line 935, in perform_statement
    result = self.perform_simple_statement(stmt)
  File "/usr/bin/cqlsh", line 968, in perform_simple_statement
    self.print_result(rows, self.parse_for_table_meta(statement.query_string))
  File "/usr/bin/cqlsh", line 946, in parse_for_table_meta
    parsed = cqlruleset.cql_parse(query_string)[1]
IndexError: list index out of range
{code}

> cqlsh error for query against collection index - list index out of range
> ------------------------------------------------------------------------
>
>                 Key: CASSANDRA-7588
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7588
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: dan jatnieks
>            Assignee: Robert Stupp
>              Labels: cqlsh
>             Fix For: 2.1.1
>
>         Attachments: 7588-cqlsh-6910-contains-allow-filtering.txt
>
>
> This worked in 2.1 RC1
> {noformat}
> Connected to Test Cluster at 127.0.0.1:9042.
> [cqlsh 5.0.1 | Cassandra 2.1.0-rc1-SNAPSHOT | CQL spec 3.1.7 | Native protocol v3]
> Use HELP for help.
> cqlsh> use k1;
> cqlsh:k1> SELECT id, description FROM products WHERE categories CONTAINS 'hdtv';
>  id    | description
> -------+-----------------------------
>  29412 |    32-inch LED HDTV (black)
>  34134 | 120-inch 1080p 3D plasma TV
> (2 rows)
> {noformat}
> But fails on 2.1:
> {noformat}
> Connected to Test Cluster at 127.0.0.1:9042.
> [cqlsh 5.0.1 | Cassandra 2.1.0-rc4-SNAPSHOT | CQL spec 3.2.0 | Native protocol v3]
> Use HELP for help.
> cqlsh> use k1;
> cqlsh:k1> SELECT id, description FROM products WHERE categories CONTAINS 'hdtv';
> list index out of range
> cqlsh:k1>
> {noformat}
> This is using the example from the blog post http://www.datastax.com/dev/blog/cql-in-2-1
> A more complete repro:
> {noformat}
> cqlsh:k1>
> cqlsh:k1> CREATE KEYSPACE cat_index_test
>       ... WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
> cqlsh:k1> USE cat_index_test;
> cqlsh:cat_index_test>
> cqlsh:cat_index_test>  CREATE TABLE IF NOT EXISTS products (
>                   ...       id int PRIMARY KEY,
>                   ...       description text,
>                   ...       price int,
>                   ...       categories set<text>,
>                   ...       features map<text, text>
>                   ...   );
> cqlsh:cat_index_test>
> cqlsh:cat_index_test>   CREATE INDEX IF NOT EXISTS cat_index ON products(categories);
> cqlsh:cat_index_test>   CREATE INDEX IF NOT EXISTS feat_index ON products(features);
> cqlsh:cat_index_test>
> cqlsh:cat_index_test>   INSERT INTO products(id, description, price, categories, features)
>                   ...        VALUES (34134,
>                   ...                '120-inch 1080p 3D plasma TV',
>                   ...                9999,
>                   ...                {'tv', '3D', 'hdtv'},
>                   ...                {'screen' : '120-inch', 'refresh-rate' : '400hz', 'techno' : 'plasma'});
> cqlsh:cat_index_test>
> cqlsh:cat_index_test>   INSERT INTO products(id, description, price, categories, features)
>                   ...        VALUES (29412,
>                   ...                '32-inch LED HDTV (black)',
>                   ...                929,
>                   ...                {'tv', 'hdtv'},
>                   ...                {'screen' : '32-inch', 'techno' : 'LED'});
> cqlsh:cat_index_test>
> cqlsh:cat_index_test>   INSERT INTO products(id, description, price, categories, features)
>                   ...        VALUES (38471,
>                   ...                '32-inch LCD TV',
>                   ...                110,
>                   ...                {'tv', 'used'},
>                   ...                {'screen' : '32-inch', 'techno' : 'LCD'});
> cqlsh:cat_index_test>   SELECT id, description FROM products WHERE categories CONTAINS 'hdtv';
> list index out of range
> cqlsh:cat_index_test>   SELECT id, description FROM products WHERE features CONTAINS '32-inch';
> list index out of range
> cqlsh:cat_index_test> DROP INDEX feat_index;
> cqlsh:cat_index_test> CREATE INDEX feat_key_index ON products(KEYS(features));
> cqlsh:cat_index_test>
> cqlsh:cat_index_test> SELECT id, description
>                   ... FROM products
>                   ... WHERE features CONTAINS KEY 'refresh-rate';
> list index out of range
> {noformat}
> This appears to be a cqlsh issue, since these queries still work when executed using DevCenter.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)