Return-Path: Delivered-To: apmail-lucene-hadoop-commits-archive@locus.apache.org Received: (qmail 41236 invoked from network); 7 Aug 2007 21:56:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Aug 2007 21:56:51 -0000 Received: (qmail 99637 invoked by uid 500); 7 Aug 2007 21:56:50 -0000 Delivered-To: apmail-lucene-hadoop-commits-archive@lucene.apache.org Received: (qmail 99612 invoked by uid 500); 7 Aug 2007 21:56:50 -0000 Mailing-List: contact hadoop-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hadoop-dev@lucene.apache.org Delivered-To: mailing list hadoop-commits@lucene.apache.org Received: (qmail 99603 invoked by uid 99); 7 Aug 2007 21:56:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Aug 2007 14:56:50 -0700 X-ASF-Spam-Status: No, hits=-100.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, 07 Aug 2007 21:56:44 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id A71415A24F for ; Tue, 7 Aug 2007 21:56:27 +0000 (GMT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: hadoop-commits@lucene.apache.org Date: Tue, 07 Aug 2007 21:56:27 -0000 Message-ID: <20070807215627.3204.99910@eos.apache.org> Subject: [Lucene-hadoop Wiki] Update of "Hbase/HbaseShell/Examples" by udanax X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Lucene-hadoop Wiki" for change notification. The following page has been changed by udanax: http://wiki.apache.org/lucene-hadoop/Hbase/HbaseShell/Examples New page: = Example Of Hbase Shell Use = [[TableOfContents(4)]] ---- == Basic Data Manipulation Examples On Hbase Shell == === Create a table in an HBase === {{{ HBase > CREATE Movie ( --> year, length, inColor, studioName, vote, producer) --> NUM_VERSIONS 10; HBase > CREATE MovieStar ( --> biography, filmography, gender, birthDate) --> NUM_VERSIONS 10; }}} === Insert data into a table === {{{ HBase > INSERT INTO Movie (year:, length:, inColor:, studioName:, vote:user_1, producer:) --> VALUES ('1977', '124', 'true', 'Fox', '5', 'George Lucas') --> WHERE row='Star Wars'; HBase > INSERT INTO MovieStar (biography:, 'filmography:Star Wars', gender:, birthDate:) --> VALUES ('blah blah', 'starring', 'male', 'March 31, 1971') --> WHERE row='Ewan Gordon Mc.Gregor'; }}} === Show all data in a table === {{{ HBase > SELECT * Movie; }}} ||Row Key ||<-12>Column Families || ||title ||<-2> year ||<-2>length ||<-2>inColor ||<-2> studioName ||<-2> vote ||<-2> producer || ||Star Wars ||year: || 1977 ||length: || 124 ||inColor: || true ||studioName: || Fox || vote:''user_1'' || 5 || producer: || George Lucas || || || || || || || || || || || vote:''user_2'' || 2 || || || ||Mighty Ducks ||year: || 1991 ||length: || 104 ||inColor: || true ||studioName: || Disney || vote:''user_1'' || 2 || producer: || Blair Peters || || || || || || || || || || || vote:''user_3'' || 4 || || || ||Wayne's World ||year: || 1992 ||length: || 95 ||inColor: || true ||studioName: || Paramount || vote:''user_2'' || 3 || producer: || Penelope Spheeris || || || || || || || || || || || vote:''user_3'' || 4 || || || {{{ HBase > SELECT * MovieStar; }}} ||Row Key ||<-8>Column Families || ||starName ||<-2> biography ||<-2>filmography ||<-2>gender ||<-2> birthDate || ||Ewan Gordon Mc.Gregor ||biography: ||blah blah ||filmography:Star Wars ||starring ||gender: ||male ||birthDate: ||March 31, 1971 || || || || ||filmography:Emma ||extra || || || || || ||Kenan Thompson ||biography: ||blah blah ||filmography:Mighty Ducks ||starring ||gender: ||male ||birthDate: ||May 10, 1978 || || || || ||filmography:Big Fat Liar ||cameo || || || || || ||keanu reeves ||biography: ||blah blah ||filmography:Constantine ||starring ||gender: ||male ||birthDate: ||September 2, 1964|| || || || ||filmography:The Matrix Reloaded ||starring || || || || || === Transactions === {{{ START TRANSACTION ON 'Star Wars' OF Movie; INSERT INTO Movie ('character:Luke Skywalker', 'character:Han Solo') VALUES ('Mark Hamil', 'Harrison Ford') WHERE row = 'Star Wars'; INSERT INTO Movie (genre:) VALUES ('action, adventure, fantasy') WHERE row = 'Star Wars'; COMMIT; }}} ||Row Key ||<-12>Column Families || ||title ||<-2> year ||<-2>length ||<-2>inColor ||<-2> studioName ||<-2> vote ||<-2> producer ||<-2> character ||<-2> genre || ||Star Wars ||year: || 1977 ||length: || 124 ||inColor: || true ||studioName: || Fox || vote:''user_1'' || 5 || producer: || George Lucas || character:Luke Skywalker || Mark Hamil || genre: || action, adventure, fantasy || || || || || || || || || || || vote:''user_2'' || 2 || || || character:Han Solo || Harrison Ford || || || || ||Mighty Ducks ||year: || 1991 ||length: || 104 ||inColor: || true ||studioName: || Disney || vote:''user_1'' || 2 || producer: || Blair Peters || || || || || || || || || || || || || || || || || vote:''user_3'' || 4 || || || || || || || ||Wayne's World ||year: || 1992 ||length: || 95 ||inColor: || true ||studioName: || Paramount || vote:''user_2'' || 3 || producer: || Penelope Spheeris || || || || || || || || || || || || || || || vote:''user_3'' || 4 || || || || || || || ---- == Relational Operations Example On Hbase Altools == ||Row Key ||||||||||||||||||||||||Column Families || ||title |||| year ||||length ||||inColor |||| studioName |||| vote |||| producer || ||Star Wars ||year: || 1977 ||length: || 124 ||inColor: || true ||studioName: || Fox || vote:''user_1'' || 5 || producer: || George Lucas || || || || || || || || || || || vote:''user_2'' || 2 || || || ||Mighty Ducks ||year: || 1991 ||length: || 104 ||inColor: || true ||studioName: || Disney || vote:''user_1'' || 2 ||