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

[jira] [Comment Edited] (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=14070649#comment-14070649 ] 

Robert Stupp edited comment on CASSANDRA-7588 at 7/22/14 6:33 PM:
------------------------------------------------------------------

This is a regression of CASSANDRA-6910.
Suggestion: revert commit for CASSANDRA-6910 and implement CASSANDRA-6910 properly in 2.1.1

I had a similar failure (_list index out of range_) with UDFs ({{::}} notation). Reason is that cqlsh does not "recognize" the {{::}} notation in its grammar - same for this issue: cqlsh does not know about {{contains}}.

EDIT: "properly" means to check every {{SELECT}} statement variant with cqlsh.


was (Author: snazy):
This is a regression of CASSANDRA-6910.
Suggestion: revert commit for CASSANDRA-6910 and implement CASSANDRA-6910 properly in 2.1.1

I had a similar failure (_list index out of range_) with UDFs ({{::}} notation). Reason is that cqlsh does not "recognize" the {{::}} notation in its grammar - same for this issue: cqlsh does not know about {{contains}}.

> 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
>              Labels: cqlsh
>
> 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 with RC4:
> {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.2#6252)