Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D954811113 for ; Tue, 22 Jul 2014 18:46:40 +0000 (UTC) Received: (qmail 89616 invoked by uid 500); 22 Jul 2014 18:46:40 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 89584 invoked by uid 500); 22 Jul 2014 18:46:40 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 89562 invoked by uid 99); 22 Jul 2014 18:46:40 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jul 2014 18:46:40 +0000 Date: Tue, 22 Jul 2014 18:46:40 +0000 (UTC) From: "Robert Stupp (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-7588) cqlsh error for query against collection index - list index out of range MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-7588?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14070678#comment-14070678 ] Robert Stupp commented on CASSANDRA-7588: ----------------------------------------- Yes - 6910 went into 2.1 branch - not in 2.1.0 branch. I'll try if a similar fix works for this - need 15 minutes... > 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, > ... features map > ... ); > 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)