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 CC2579447 for ; Sat, 15 Oct 2011 21:58:34 +0000 (UTC) Received: (qmail 31514 invoked by uid 500); 15 Oct 2011 21:58:33 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 31470 invoked by uid 500); 15 Oct 2011 21:58:33 -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 31101 invoked by uid 99); 15 Oct 2011 21:58:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Oct 2011 21:58:33 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Oct 2011 21:58:32 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 22193309D08 for ; Sat, 15 Oct 2011 21:58:12 +0000 (UTC) Date: Sat, 15 Oct 2011 21:58:12 +0000 (UTC) From: "Jonathan Ellis (Commented) (JIRA)" To: commits@cassandra.apache.org Message-ID: <1619175848.17708.1318715892141.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1949417367.17670.1318715291957.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CASSANDRA-3367) data created before index is not returned in where query 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-3367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13128293#comment-13128293 ] Jonathan Ellis commented on CASSANDRA-3367: ------------------------------------------- Did you verify that the index had finished building first? > data created before index is not returned in where query > -------------------------------------------------------- > > Key: CASSANDRA-3367 > URL: https://issues.apache.org/jira/browse/CASSANDRA-3367 > Project: Cassandra > Issue Type: Bug > Components: Core > Affects Versions: 1.0.0 > Reporter: Cathy Daw > > *CQL version of bug* > {code} > // CREATE KS AND CF > CREATE KEYSPACE ks1 with > strategy_class = > 'org.apache.cassandra.locator.SimpleStrategy' > and strategy_options:replication_factor=1; > use ks1; > DROP COLUMNFAMILY users; > CREATE COLUMNFAMILY users ( > KEY varchar PRIMARY KEY, password varchar, gender varchar, > session_token varchar, state varchar, birth_year bigint); > // INSERT DATA > INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user1', 'ch@ngem3a', 'f', 'TX', '1968'); > INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user2', 'ch@ngem3b', 'm', 'CA', '1971'); > // CREATE INDEX > CREATE INDEX gender_key ON users (gender); > CREATE INDEX state_key ON users (state); > CREATE INDEX birth_year_key ON users (birth_year); > // INSERT DATA > INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user3', 'ch@ngem3c', 'f', 'FL', '1978'); > INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user4', 'ch@ngem3d', 'm', 'TX', '1974'); > // VERIFY DATA > cqlsh> select * from users; > KEY | birth_year | gender | password | state | > user1 | 1968 | f | ch@ngem3a | TX | > user4 | 1974 | m | ch@ngem3d | TX | > user3 | 1978 | f | ch@ngem3c | FL | > user2 | 1971 | m | ch@ngem3b | CA | > //BUG : missing row from user1, created before index was added > cqlsh> select * from users where state='TX'; > KEY | birth_year | gender | password | state | > user4 | 1974 | m | ch@ngem3d | TX | > //BUG : missing row from user2, created before index was added > cqlsh> select * from users where state='CA'; > {code} > *CLI version of bug* > {code} > // CREATE KS AND CF > CREATE keyspace ks1 with > placement_strategy = > 'org.apache.cassandra.locator.SimpleStrategy' > and strategy_options = [{replication_factor:1}]; > use ks1; > drop column family users; > create column family users > with comparator = UTF8Type > and key_validation_class = UTF8Type > and default_validation_class = UTF8Type > and column_metadata = [{column_name: password, validation_class:UTF8Type} > {column_name: gender, validation_class: UTF8Type}, > {column_name: session_token, validation_class: UTF8Type}, > {column_name: state, validation_class: UTF8Type}, > {column_name: birth_year, validation_class: LongType}]; > // INSERT DATA > set users['user1']['password']='ch@ngem3a'; > set users['user1']['gender']='f'; > set users['user1']['state']='TX'; > set users['user1']['birth_year']='1968'; > set users['user2']['password']='ch@ngem3b'; > set users['user2']['gender']='m'; > set users['user2']['state']='CA'; > set users['user2']['birth_year']='1971'; > // ADD INDEX > update column family users > with comparator = UTF8Type > and key_validation_class = UTF8Type > and default_validation_class = UTF8Type > and column_metadata = [{column_name: password, validation_class:UTF8Type} > {column_name: gender, validation_class: UTF8Type, index_type: KEYS}, > {column_name: session_token, validation_class: UTF8Type}, > {column_name: state, validation_class: UTF8Type, index_type: KEYS}, > {column_name: birth_year, validation_class: LongType, index_type: KEYS}]; > // INSERT DATA > set users['user3']['password']='ch@ngem3b'; > set users['user3']['gender']='f'; > set users['user3']['state']='FL'; > set users['user3']['birth_year']='1978'; > set users['user4']['password']='ch@ngem3c'; > set users['user4']['gender']='m'; > set users['user4']['state']='TX'; > set users['user4']['birth_year']='1974'; > // VERIFY DATA > [default@cqldb] list users; > Using default limit of 100 > ------------------- > RowKey: user1 > => (column=birth_year, value=1968, timestamp=1318714655921000) > => (column=gender, value=f, timestamp=1318714655917000) > => (column=password, value=ch@ngem3a, timestamp=1318714655908000) > => (column=state, value=TX, timestamp=1318714655919000) > ------------------- > RowKey: user4 > => (column=birth_year, value=1974, timestamp=1318714671608000) > => (column=gender, value=m, timestamp=1318714670666000) > => (column=password, value=ch@ngem3c, timestamp=1318714670665000) > => (column=state, value=TX, timestamp=1318714670668000) > ------------------- > RowKey: user3 > => (column=birth_year, value=1978, timestamp=1318714670662000) > => (column=gender, value=f, timestamp=1318714670657000) > => (column=password, value=ch@ngem3b, timestamp=1318714670654000) > => (column=state, value=FL, timestamp=1318714670660000) > ------------------- > RowKey: user2 > => (column=birth_year, value=1971, timestamp=1318714657353000) > => (column=gender, value=m, timestamp=1318714655924000) > => (column=password, value=ch@ngem3b, timestamp=1318714655923000) > => (column=state, value=CA, timestamp=1318714655926000) > 4 Rows Returned. > //BUG : missing row from user1, created before index was added > [default@cqldb] get users where state='TX'; > ------------------- > RowKey: user4 > => (column=birth_year, value=1974, timestamp=1318714671608000) > => (column=gender, value=m, timestamp=1318714670666000) > => (column=password, value=ch@ngem3c, timestamp=1318714670665000) > => (column=state, value=TX, timestamp=1318714670668000) > //BUG : missing row from user2, created before index was added > [default@cqldb] get users where state='CA'; > 0 Row Returned. > {code} -- 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