hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Lucene-hadoop Wiki] Trivial Update of "Hbase/HbaseShell" by udanax
Date Fri, 23 Nov 2007 05:55:06 GMT
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

------------------------------------------------------------------------------
  Copyright (c) 2007 by udanax, licensed to Apache Software Foundation.
  Type 'help;' for usage.
  
- Hbase >}}}
+ hql >}}}
  
  All commands are terminated with a semi-colon: e.g. Type 'help;' to see list of available
commands.
  
@@ -83, +83 @@

  === Create the table in a Hbase ===
  
  {{{
- Hbase > help create;
+ hql > help create;
  CREATE    Create tables
  
  Syntax:
@@ -108, +108 @@

   * ~-'''BLOOMFILTER''' specifies which bloom filter to use for the column family. By default,
none of the bloom filters is used. You can specify the options in two ways: with '''VECTOR_SIZE'''
and '''NUM_HASH''', or with '''NUM_ENTRIES'''. '''VECTOR_SIZE''' specifies the number of elements
in the vector, and '''NUM_HASH''' specifies the number of hash functions to use; With '''NUM_ENTRIES''',
you  specify only the approximated number of entries in the column, and '''VECTOR_SIZE'''
and '''NUM_HASH''' are automatically determined.-~
  
  {{{
- Hbase > CREATE TABLE movieLog_table (
+ hql > CREATE TABLE movieLog_table (
-     --> year, length, inColor, studioName, vote, producer, actor)
+   --> year, length, inColor, studioName, vote, producer, actor)
-     --> NUM_VERSIONS 10; 
+   --> NUM_VERSIONS 10; 
  
- Hbase > CREATE TABLE webtable (
+ hql > CREATE TABLE webtable (
-     --> contents in_memory max_versions=10 compression=block,
+   --> contents in_memory max_versions=10 compression=block,
-     --> anchor max_length=256 bloomfilter=counting                                  
+   --> anchor max_length=256 bloomfilter=counting                                  
-     --> vector_size=1000000 num_hash=4);
+   --> vector_size=1000000 num_hash=4);
  }}}
  
  === Select data from a table ===
  {{{
- Hbase > help select;
+ hql > help select;
  SELECT    Select values from tables
  
  Syntax:
@@ -140, +140 @@

   * ~-'''LIMIT''' limits the number of rows to be returned.-~ 
  
  {{{
- Hbase > SELECT studioName: FROM movieLog_table WHERE row = 'Star Wars';
+ hql > SELECT studioName: FROM movieLog_table WHERE row = 'Star Wars';
  
  +---------------------------------------------+
  | title         studioName                    |
@@ -150, +150 @@

  
  Successfully print out the selected data.(0.05 sec)
  
- Hbase > SELECT 'studioName:YoungGu Art, Corp.' FROM movieLog_table WHERE row = 'D-War';
+ hql > SELECT 'studioName:YoungGu Art, Corp.' FROM movieLog_table WHERE row = 'D-War';
  }}}
  
  === Insert data into a table ===
  {{{
- Hbase > help insert;
+ hql > help insert;
  INSERT    Insert values into tables
  
  Syntax:
@@ -174, +174 @@

   * ~-If '''TIMESTAMP''' is not specified for the value, the current time is used as its
timestamp.-~
  
  {{{
- Hbase > INSERT INTO movieLog_table (year:, length:, inColor:, studioName:, 'vote:user
name', producer:, 'actor:hero')
+ hql > INSERT INTO movieLog_table (year:, length:, inColor:, studioName:, 'vote:user name',
producer:, 'actor:hero')
-     --> VALUES ('1977', '124', 'true', 'Fox', '5', 'George Lucas', 'Mark Hamill')
+   --> VALUES ('1977', '124', 'true', 'Fox', '5', 'George Lucas', 'Mark Hamill')
-     --> WHERE row='Star Wars';
+   --> WHERE row='Star Wars';
  }}}
  
  
@@ -195, +195 @@

  | Mighty Ducks  1991   104     true    Paramount Pictures Corp.      |
  +--------------------------------------------------------------------+
  
- Hbase > Result = Relation.Projection('year','legnth');
+ hql > Result = Relation.Projection('year','legnth');
- Hbase > save Result into table('result');
+ hql > save Result into table('result');
  
  Result
  +------------------------------+
@@ -218, +218 @@

  | Mighty Ducks  1991   104     true    Paramount Pictures Corp.      |
  +--------------------------------------------------------------------+
  
- Hbase > Result = Relation.Selection(length > 100 and studioName = 'Fox Entertainment
Group, Inc.'); 
+ hql > Result = Relation.Selection(length > 100 and studioName = 'Fox Entertainment
Group, Inc.'); 
-      or Result = Relation.Selection(length > 100 
+    or Result = Relation.Selection(length > 100 
-         and studioName NOT IN ('Fox Entertainment Group, Inc.', 'Paramount Pictures Corp.'));
+       and studioName NOT IN ('Fox Entertainment Group, Inc.', 'Paramount Pictures Corp.'));
- Hbase > save Result into table('result');
+ hql > save Result into table('result');
  
  Result
  +--------------------------------------------------------------------+
@@ -261, +261 @@

  | Whitney Houston   Singer       Aug 9, 1963   Diva       |
  +---------------------------------------------------------+
  
- Hbase > R1 = table('movieLog_table');
+ hql > R1 = table('movieLog_table');
- Hbase > R2 = table('personInfo_table');
+ hql > R2 = table('personInfo_table');
- Hbase > Result = R1.join(R1.producer: = R2.ROW) and R2; 
+ hql > Result = R1.join(R1.producer: = R2.ROW) and R2; 
-      or Result = R1.join(R1.actor:hero = R2.Row) and R2;
+    or Result = R1.join(R1.actor:hero = R2.Row) and R2;
-      or Result = R1.join(R1.actor:heroine = R2.Row and R1.studioName = 'Warner Home Video'
and R2.occupation = 'Singer') and R2;
+    or Result = R1.join(R1.actor:heroine = R2.Row and R1.studioName = 'Warner Home Video'
and R2.occupation = 'Singer') and R2;
  
  Result
  +--------------------------------------------------------------------------------------------------------------------+
@@ -300, +300 @@

  | ...                                                                                  
           |
  +--------------------------------------------------------------------------------------------------+
  
- Hbase > R1 = table('movieLog_table');
+ hql > R1 = table('movieLog_table');
- Hbase > R2 = table('stockCompany_info');
+ hql > R2 = table('stockCompany_info');
- Hbase > result = R1.join(R1.studioName = R2.corporation) and R2;
+ hql > result = R1.join(R1.studioName = R2.corporation) and R2;
  }}}
  
  === Query mixture examples ===
@@ -319, +319 @@

  | Mighty Ducks  1991   104     true    Paramount Pictures Corp.      |
  +--------------------------------------------------------------------+
  
- Hbase > Proj = Relation.Projection('year');
+ hql > Proj = Relation.Projection('year');
- Hbase > Result = Proj.Selection(length > 100 AND studioName = 'Fox Entertainment Group,
Inc.');
+ hql > Result = Proj.Selection(length > 100 AND studioName = 'Fox Entertainment Group,
Inc.');
- Hbase > save Result into table('result');
+ hql > save Result into table('result');
  
  Result
  +----------------------+

Mime
View raw message