Return-Path: Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: (qmail 15040 invoked from network); 18 May 2010 04:13:07 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 May 2010 04:13:07 -0000 Received: (qmail 57597 invoked by uid 500); 18 May 2010 04:13:07 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 57494 invoked by uid 500); 18 May 2010 04:13:05 -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 57287 invoked by uid 99); 18 May 2010 04:13:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 May 2010 04:13:04 +0000 X-ASF-Spam-Status: No, hits=-1437.4 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 May 2010 04:13:03 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o4I4CgQ0004110 for ; Tue, 18 May 2010 04:12:43 GMT Message-ID: <11431030.98011274155962878.JavaMail.jira@thor> Date: Tue, 18 May 2010 00:12:42 -0400 (EDT) From: "Frank Du (JIRA)" To: commits@cassandra.apache.org Subject: [jira] Commented: (CASSANDRA-1088) Enable cassandra-cli to list rows, and page through rows in a column family In-Reply-To: <29668410.24861273781083894.JavaMail.jira@thor> 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-1088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12868517#action_12868517 ] Frank Du commented on CASSANDRA-1088: ------------------------------------- Hi Eric, I ran svn update to latest source code, and tested it. There is an issue, which is detailed below. However, there is no problem with {{set}} and {{get}} commands. I double checked antlr grammar to make sure it won't cause the issue. Meanwhile, CliCompiler.getKey() is not used by the new command. Therefore, I am wondering if it may be caused by other issue. How about cleaning up data and test it again? The mentioned issue stopped the {{list}} command, which I reported in CASSANDRA-1073: https://issues.apache.org/jira/browse/CASSANDRA-1073 Here is the total process: 1. Keyspace1 definition is not shown, though it is defined in cassandra.yaml. Therefore I added a keyspace 'FrankDu', in the main() method of CliMain: List cf_defs = new ArrayList(); cf_defs.add(new CfDef("FrankDu", "CF1").setComment("CF1").setComparator_type("BytesType")); KsDef ks_def = new KsDef("FrankDu", "org.apache.cassandra.locator.RackUnawareStrategy", 1, cf_defs); thriftClient_.system_add_keyspace(ks_def); 2. Ran cassandra inside eclipse first. Then started CliMain. The keyspace 'FrankDu' got created. Every commands works fine: {{set}}, {{get}}, {{list}}. So I inserted some rows. 3. Stopped both programs. Disabled the code of keyspace creation. Then ran cassandra first, and then started CliMain. This time, {{set}} and {{get}} works fine. But {{list}} command caused an java.io.EOFException in cassandra console log. It was first reported in issue CASSANDRA-1073. Now I will add detailed reproduce steps to CASSANDRA-1073, and attach last error log. The {{list}} command cannot work because of the issue. Could you please take a look into it? Thank you very much! Best Regards, Frank > Enable cassandra-cli to list rows, and page through rows in a column family > --------------------------------------------------------------------------- > > Key: CASSANDRA-1088 > URL: https://issues.apache.org/jira/browse/CASSANDRA-1088 > Project: Cassandra > Issue Type: New Feature > Components: Tools > Reporter: Frank Du > Fix For: 0.7 > > Attachments: patch.txt > > > I have been looking for showing rows and paging through rows. Finally I write this extension to cassandra-cli tool. > Let's assume that we have the following data in column family named 'CF1': > ========================= > Row 1: > key: fdu1, name: 'Frank Du', city: 'NYC' > Row 2: > key: fdu2, name: 'Jonathan Ellis' > Row 3: > key: fdu3, name: 'Eric Evans' > Syntax: > ========================= > LIST keyRangeExpression limitClause? > keyRangeExpression: > columnFamilyName[ startKey : endKey ] ( [ 'superCoumnName' ] )? > limitClause: > LIMIT count (OFFSET offset)? > \| LIMIT offset, count > The limit clause is the same with MySql. > Examples: > ========================= > // list all the 3 rows in CF1 > list CF1[ '' : '' ] > // list all rows, offset from index 1. So it will show 2 rows > list CF1[ '' : '' ] limit 1, 10 > // show the rows 'fdu2' and 'fdu3' > list CF1[ 'fdu2' : '' ] limit 10 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.