Return-Path: Delivered-To: apmail-lucene-hadoop-commits-archive@locus.apache.org Received: (qmail 99341 invoked from network); 2 Jul 2007 09:01:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jul 2007 09:01:09 -0000 Received: (qmail 3820 invoked by uid 500); 2 Jul 2007 09:01:12 -0000 Delivered-To: apmail-lucene-hadoop-commits-archive@lucene.apache.org Received: (qmail 3800 invoked by uid 500); 2 Jul 2007 09:01:11 -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 3791 invoked by uid 99); 2 Jul 2007 09:01:11 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jul 2007 02:01:11 -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; Mon, 02 Jul 2007 02:01:07 -0700 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id BEF1159A07 for ; Mon, 2 Jul 2007 09:00:47 +0000 (GMT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Apache Wiki To: hadoop-commits@lucene.apache.org Date: Mon, 02 Jul 2007 09:00:47 -0000 Message-ID: <20070702090047.9762.27546@eos.apache.org> Subject: [Lucene-hadoop Wiki] Trivial Update of "HbaseShell" 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/HbaseShell ------------------------------------------------------------------------------ ---- - = Hbase Shell Syntax Definition = + = Hbase Shell Client Syntax Definition = '''Note''' that Data should be located by their row, column, and timestamp. - == Basic Commands == + == Commands == ||'''Command''' ||'''Explanation''' || ||HELP ||<99%>'''Help''' command provides information about the use of shell script.[[BR]][[BR]]~-''HELP [function_name];''-~ || ||SHOW ||<99%>'''Show''' command will list the tables.[[BR]][[BR]]~-''SHOW tables;''-~ || ||DESC ||'''Desc''' command will provides information about the columnfamilies in a table.[[BR]][[BR]]~-''DESC table_name;''-~ || ||CREATE ||'''Create''' command will create a new table.[[BR]][[BR]]~-''CREATE table_name[[BR]]COLUMNFAMILIES('columnfamily_name1'[, 'columnfamily_name2', ...])[[BR]][LIMIT=limitNumber_of_Version];''-~ || ||DROP ||'''Drop''' command will droping columnfamilies in a table or tables.[[BR]][[BR]]~-''DROP table_name1[, table_name2, ...] or columnfamily_name1[, columnfamily_name2, ...];''-~ || - ||SUBSTITUTE[[BR]] || '''Substitute''' query to [A~Z][[BR]][[BR]]~-''X = MAPSET('table_name', 'columnfamily_name');''-~|| + ||SUBSTITUTE[[BR]] || '''Substitute''' query to [A~Z][[BR]][[BR]]~-''X = Matrix(table_name, columnfamily_name);''-~|| + ||STORE ||'''STORE''' command will store results to specified table. [[BR]][[BR]]~-''A = Table('movieLog_table'); [[BR]]B = A.Selection('length' > 100); [[BR]]STORE B TO X run_style;''-~ || - ||MAPSET || '''Map Set''' || - ||ARRAY || '''Array''' || - ||MATRIX || '''Matrix''' || - ||VECTOR || '''Vector''' || - ||PRINT ||'''Print''' command will print a results to the console output. [[BR]][[BR]]~-''A = ARRAY([1, 2, 3]);[[BR]]PRINT A;[[BR]]B = SELECT table_name WHERE row='row_key';[[BR]]PRINT B;''-~ || - ||STORE ||'''STORE''' command will store results to specified table. [[BR]][[BR]]~-''M = matrix('table_name','columnfamily_name');[[BR]]A = array([[1, 2],[3, 4]]); //In this case, Key should be an integer index. [[BR]]STORE A TO M run_style;[[BR]]B = SELECT table_name WHERE row='row_key';[[BR]]STORE B TO ('table_name','columnfamily_name1'[, 'columnfamily_name2']) run_style;''-~ || ||EXIT ||<99%>'''Exit''' from the current shell script.[[BR]][[BR]]~-''EXIT;''-~ || And, Commands to manually manipulate data on more detailed parts. ||'''Command''' ||'''Explanation''' || - ||INSERT ||<99%>'''Insert''' command will insert one row into the table with a value for specified column in the table.[[BR]][[BR]]~-''INSERT table_name[[BR]] VALUES('columnfamily_name:column_key','entry')[[BR]]WHERE row='row_key';''-~ || + ||INSERT ||<99%>'''Insert''' command will insert one row into the table with a value for specified column in the table.[[BR]][[BR]]~-''INSERT table_name ('columnfamily_name1:column_key'[, 'columnfamily_name2:column_key', ...])[[BR]] VALUESVALUES ('entry1'[, 'entry2', ...])[[BR]]WHERE row='row_key';''-~ || ||SET ||'''SET''' command will change the values. [[BR]][[BR]]~-''SET table_name[[BR]] VALUES('columnfamily_name:column_key','entry')[[BR]]WHERE row='row_key' AND time='Specified_Timestamp';''-~ || ||DELETE ||'''Delete''' command will delete specified rows in table. [[BR]][[BR]]~-''DELETE table_name[[BR]]WHERE row='row_key'[[BR]][AND column='columnfamily_name:column_key'];''-~ || ||SELECT ||<99%>'''Select''' command will retrieves rows from a table.[[BR]][[BR]]~-''SELECT table_name[[BR]][WHERE row='row_key'][[BR]][AND column='columnfamily_name:column_key'];[[BR]][AND time='Specified_Timestamp'];[[BR]][LIMIT=Number_of_Version];''-~ || - === Relational Algebra Operators === + == Relational Operations == - Set Operations.. + ||'''Operators''' ||'''Explanation''' || + ||PROJECTION||<99%>is defined as the set that is obtained when all tuples in ~+R+~ are restricted to the set {a,,1,,,...,a,,n,,}.|| - ||UNION||<99%>'''Union''' A∪B contains all the elements of A and it contains all the elements of B.|| - ||INTERSECTION||<99%>'''Intersection''' A∩B is a subset of A and it is a subset of B.|| - ||DIFFERENCE||<99%>'''Difference''' of A and B (A-B).|| - - - A = MAPSET(table_T, columnfamily_A);[[BR]] - B = MAPSET(table_T, columnfamily_B);[[BR]] - - C = A.Union(B);[[BR]] - C = A.Intersection(B);[[BR]] - C = A.Difference(B); - - ||'''Operators''' ||'''Explanation''' || - ||PROJECTION||<99%>...|| ||SELECTION||<99%>...|| ||PRODUCT||<99%>...|| - ||RENAMING||<99%>...|| + ||RENAME||<99%>'''Rename''' r to x|| - ||GROUPING||<99%>...|| + ||GROUP||<99%>...|| ||SORT||<99%>...|| + ||'''Operators''' ||'''Explanation''' || + ||UNION ||<99%>'''Union''' A∪B contains all the elements of A and it contains all the elements of B.|| + ||INTERSECTION ||<99%>'''Intersection''' A∩B is a subset of A and it is a subset of B.|| + ||DIFFERENCE ||'''Difference''' of A and B (A-B).|| - A.Projection('year','length');[[BR]] - A.Selection('length' > 100); - - - === Aggregation Functions === ||'''Functions''' ||'''Explanation''' || ||AVG ||<99%>...|| @@ -107, +88 @@ ||MIN ||<99%>...|| ||MAX ||<99%>...|| - The Matrix commands are used to store a 2D array of numerical data values. [[BR]]A number of routines are provided to manipulate the matrix object directly, illustrated below by simple examples. - - '''Note''' that vectors should be defined as two-dimensional matrices to distinguish between row and column vectors [[BR]]in order to be able to perform matrix operations consistently. - - === Matrix Construction Functions === - .. - - === Matrix Algebra Functions === + == Matrix Operations == - .. - === Special functions === - .. + ||'''Operation''' ||'''Explanation''' || + ||DOUBLEMATRIX||<99%>...|| + ||BOOLEANMATRIX||<99%>...|| + + ||'''Functions''' ||'''Explanation''' || + ||QR ||<99%>...|| + ||LU||<99%>...|| + ||SVD ||<99%>...|| + ---- = Example Of Hbase Shell Use = == Basic Usage == - {{{ + === Create the table in a HBase === + - Hbase > CREATE movieLog_table + ~-''CREATE movieLog_table - --> COLUMNFAMILIES('year','length','inColor','studioName',vote','producer') + [[BR]]COLUMNFAMILIES('year', 'length', 'inColor', 'studioName', 'vote', 'producer') - --> limit=10; + [[BR]]LIMIT=1;''-~ - }}} + === Insert data into a table === + ~-''INSERT table_name ('year:', 'length:', 'inColor:', 'studioName:', 'vote:user_1', 'producer') + [[BR]]VALUES ('1977', '124', 'true', 'Fox', '5', 'George Lucas') + [[BR]]WHERE row='Star Wars';''-~ - '''movieLog_table''' + === Show all data in a table === + ~-''SELECT movieLog_table;''-~ + ||Row Key ||<-12>Column Families || - ||title ||<-2> year ||<-2>length ||<-2>inColor ||<-2> studioName ||<-2> vote ||<-2> producer || + ||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 || @@ -141, +127 @@ || || || || || || || || || || vote:''user_3'' || 4 || || || - == Relation Algebra Operations == + == Relation Operations == - '''Projection''' + === Projection === + + ~-''A = Table('movieLog_table'); + [[BR]]B = A.Projection('year','length');''-~ '''~+^π^+~'''~-title-~,~-year-~,~-length-~'''~+^(movieLog_table)^+~''' @@ -154, +143 @@ - '''Selection''' + === Selection === + + ~-''A = Table('movieLog_table'); + [[BR]]B = A.Selection('length' > 100);''-~ '''~+^σ^+~'''~-length>100-~'''~+^(movieLog_table)^+~''' @@ -163, +155 @@ ||Mighty Ducks ||1991 ||104 ||true ||Disney ||67890 || - '''Example''' + === Example === + ~-''A = Table('movieLog_table'); + [[BR]]B = A.Selection(length > 100 AND studioName = 'Fox'); + [[BR]]C = B.Projection('year');''-~ + - '''~+^π^+~'''~-title-~,~-year-~'''~+^σ^+~'''~-length>100-~'''~+^(movieLog_table)∩σ^+~'''~-studioName='Fox'-~'''~+^(movieLog_table))^+~''' + '''~+^π^+~'''~-title-~,~-year-~'''~+^(σ^+~'''~-length>100-~'''~+^(movieLog_table)∩σ^+~'''~-studioName='Fox'-~'''~+^(movieLog_table))^+~''' + + ||title ||year || + ||Star Wars ||1977 || == Matrix Operations == - {{{ - Hbase > A = matrix('movieLog_table', 'vote'); - Hbase > PRINT A; - }}} + Lets construct a abstract sparse row-by-column matrix. + + ~-''A = doubleMatrix('movieLog_table','vote');''-~ || ||user_1 ||user_2 ||user_3 || - ||Star Wars || 5 || 2 || 0 || + ||Star Wars || 5.0 || 2.0 || || - ||Mighty Ducks || 2 || 0 || 4 || + ||Mighty Ducks || 2.0 || || 4.0 || - ||Wayne's World || 0 || 3 || 4 || + ||Wayne's World || || 3.0 || 4.0 || + ---- = Matrix Extension Example On Hbase Shell = @@ -194, +193 @@ == Scalable Collaborative Filtering With A Large User-By-Item Matrix == - .. + + Title-By-Title Triangular Matrix + + || ||Star Wars ||Mighty Ducks ||Wayne's World || + ||Star Wars || || 0.415 || 0.222 || + ||Mighty Ducks || || || 0.715 || + ||Wayne's World || || || || + == Consistency Assessment Of Topological Relationship By Matrix-Union == .. + + ---- + = Performance Reports = + .. + ---- = People Involved =