Return-Path: Delivered-To: apmail-hadoop-core-commits-archive@www.apache.org Received: (qmail 82382 invoked from network); 18 Mar 2008 19:32:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Mar 2008 19:32:50 -0000 Received: (qmail 35561 invoked by uid 500); 18 Mar 2008 19:32:47 -0000 Delivered-To: apmail-hadoop-core-commits-archive@hadoop.apache.org Received: (qmail 35435 invoked by uid 500); 18 Mar 2008 19:32:46 -0000 Mailing-List: contact core-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-commits@hadoop.apache.org Received: (qmail 35182 invoked by uid 99); 18 Mar 2008 19:32:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Mar 2008 12:32:45 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Mar 2008 19:32:05 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 98039D2DB for ; Tue, 18 Mar 2008 19:32:16 +0000 (GMT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: core-commits@hadoop.apache.org Date: Tue, 18 Mar 2008 19:32:16 -0000 Message-ID: <20080318193216.1054.90494@eos.apache.org> Subject: [Hadoop Wiki] Trivial Update of "Hbase/Jython" by stack X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification. The following page has been changed by stack: http://wiki.apache.org/hadoop/Hbase/Jython The comment on the change is: Added another jython example ------------------------------------------------------------------------------ }}} + == Another Sample == + {{{# Print all rows that are members of a particular column family + # by passing a regex for family qualifier (HQL does not support + # + # To run this script, I did the following: + + # $ HBASE_OPTS="-Dpython.path=$JYTHON_HOME" HBASE_CLASSPATH=$JYTHON_HOME/jython.jar ./bin/hbase org.python.util.jython select.jython + # + from org.apache.hadoop.hbase import HBaseConfiguration, HTable, HStoreKey + from org.apache.hadoop.io import Text + from java.util import TreeMap + from jarray import array + + c = HBaseConfiguration() + t = HTable(c, Text("enwiki_080103")) + b = Text("title:.*$") + columns = array([a], Text) + scanner = t.obtainScanner(columns, Text("")) + key = HStoreKey() + value = TreeMap() + while 1: + result = scanner.next(key, value) + if not result: + break + print key}}} +