Return-Path: Delivered-To: apmail-lucene-hadoop-commits-archive@locus.apache.org Received: (qmail 80390 invoked from network); 15 Jan 2008 12:38:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Jan 2008 12:38:40 -0000 Received: (qmail 34297 invoked by uid 500); 15 Jan 2008 12:38:30 -0000 Delivered-To: apmail-lucene-hadoop-commits-archive@lucene.apache.org Received: (qmail 34259 invoked by uid 500); 15 Jan 2008 12:38:30 -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 34244 invoked by uid 99); 15 Jan 2008 12:38:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jan 2008 04:38:30 -0800 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, 15 Jan 2008 12:38:24 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 82864D2D5 for ; Tue, 15 Jan 2008 12:38:16 +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, 15 Jan 2008 12:38:16 -0000 Message-ID: <20080115123816.25235.92516@eos.apache.org> Subject: [Lucene-hadoop Wiki] Trivial Update of "Hbase/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/Hbase/HbaseShell ------------------------------------------------------------------------------ All commands are terminated with a semi-colon: e.g. Type 'help;' to see list of available commands. - = HQL(Hbase Query Language) Commands = + = HQL = + + == HQL Client API == + {{{#!java + HQLClient hql = new HQLClient(conf, MASTER_ADDRESS); + ReturnMsg rs = hql.executeQuery(queryStr); + + System.out.println(rs.getMsg()); + }}} '''Note''' that attribute values are quoted with either single or double quotes. - == Basic Query Commands == - === Basic administration commands === + == Query Grammars == + === Database administration language === - ||'''Command''' ||'''Explanation''' || + ||'''syntax''' ||'''Explanation''' || - ||Help ||<99%>'''Help''' command provides information about the use of shell script.[[BR]][[BR]]~-''HELP [function_name];''-~ || + ||Help ||<99%>'''Help''' syntax provides information about the use of shell script.[[BR]][[BR]]~-''HELP [function_name];''-~ || - ||Show ||<99%>'''Show''' command lists tables.[[BR]][[BR]]~-''SHOW tables;''-~ || + ||Show ||<99%>'''Show''' syntax lists tables.[[BR]][[BR]]~-''SHOW tables;''-~ || - ||Describe ||'''Describe''' command provides information about the columnfamilies in a table.[[BR]][[BR]]~-''DESC table_name;''-~ || + ||Describe ||'''Describe''' syntax provides information about the columnfamilies in a table.[[BR]][[BR]]~-''DESC table_name;''-~ || ||FS ||<99%>'''Filesystem''' commands.[[BR]][[BR]]~-''FS [-option] arguments...;''-~ || - ||JAR ||<99%>'''JAR''' command to run hadoop jar commands.[[BR]][[BR]]~-''JAR jarFile [mainClass] args...;''-~|| + ||JAR ||<99%>'''JAR''' syntax to run hadoop jar commands.[[BR]][[BR]]~-''JAR jarFile [mainClass] args...;''-~|| ||Clear ||<99%>'''Clear''' the screen.[[BR]][[BR]]~-''CLEAR;''-~ || ||Exit ||<99%>'''Exit''' from the current shell script.[[BR]][[BR]]~-''EXIT;''-~ || - === Data definition commands === + === Data definition language === - Data definition commands to define data tables + Data definition langague to define data tables - ||'''Command''' ||'''Explanation''' || + ||'''Syntax''' ||'''Explanation''' || - ||Create ||<99%>'''Create''' command creates a new table.[[BR]][[BR]]~-''CREATE TABLE table_name ([[BR]]{{{ }}}column_family_definition[[BR]]{{{ }}}[, column_family_spec][[BR]]{{{ }}}...[[BR]])[[BR]][[BR]]''-~'''colum_family_definition:'''~-''[[BR]]column_family_name[[BR]]{{{ }}}[MAX_VERSIONS=n][[BR]]{{{ }}}[MAX_LENGTH=n][[BR]]{{{ }}}[COMPRESSION=NONE|BLOCK|RECORD][[BR]]{{{ }}}[IN_MEMORY][[BR]]{{{ }}}[BLOOMFILTER=NONE|BLOOMFILTER|COUNTING_BLOOMFILTER|RETOUCHED_BLOOMFILTER VECTOR_SIZE=n NUM_HASH=n]''-~ || + ||Create ||<99%>'''Create''' syntax creates a new table.[[BR]][[BR]]~-''CREATE TABLE table_name ([[BR]]{{{ }}}column_family_definition[[BR]]{{{ }}}[, column_family_spec][[BR]]{{{ }}}...[[BR]])[[BR]][[BR]]''-~'''colum_family_definition:'''~-''[[BR]]column_family_name[[BR]]{{{ }}}[MAX_VERSIONS=n][[BR]]{{{ }}}[MAX_LENGTH=n][[BR]]{{{ }}}[COMPRESSION=NONE|BLOCK|RECORD][[BR]]{{{ }}}[IN_MEMORY][[BR]]{{{ }}}[BLOOMFILTER=NONE|BLOOMFILTER|COUNTING_BLOOMFILTER|RETOUCHED_BLOOMFILTER VECTOR_SIZE=n NUM_HASH=n]''-~ || - ||Alter ||<99%>'''Alter''' command changes the structure of the specified table.[[BR]][[BR]]~-''ALTER TABLE table_name[[BR]]{{{ }}}alter_definition [, alter_definition] ...[[BR]][[BR]]''-~'''alter_definition:'''~-''[[BR]]{{{ }}}ADD column_family_definition[[BR]]{{{ }}}| ADD (column_family_definition, ...)[[BR]]{{{ }}}| DROP column_family_name[[BR]]{{{ }}}| CHANGE column_family_name column_family_definition''-~|| + ||Alter ||<99%>'''Alter''' syntax changes the structure of the specified table.[[BR]][[BR]]~-''ALTER TABLE table_name[[BR]]{{{ }}}alter_definition [, alter_definition] ...[[BR]][[BR]]''-~'''alter_definition:'''~-''[[BR]]{{{ }}}ADD column_family_definition[[BR]]{{{ }}}| ADD (column_family_definition, ...)[[BR]]{{{ }}}| DROP column_family_name[[BR]]{{{ }}}| CHANGE column_family_name column_family_definition''-~|| - ||Drop ||'''Drop''' command drops columnfamilies in a table or tables.[[BR]][[BR]]~-''DROP TABLE table_name1[, table_name2, ...];''-~ || + ||Drop ||'''Drop''' syntax drops columnfamilies in a table or tables.[[BR]][[BR]]~-''DROP TABLE table_name1[, table_name2, ...];''-~ || - ||Truncate ||'''Truncate''' command cleans all data from a table. [[BR]][[BR]]~-''TRUNCATE TABLE table_name;''-~ || + ||Truncate ||'''Truncate''' Syntax cleans all data from a table. [[BR]][[BR]]~-''TRUNCATE TABLE table_name;''-~ || - === Data manipulation commands === + === Data manipulation language === - Data manipulation commands to manually manipulate data on more detailed parts + Data manipulation language to manually manipulate data on more detailed parts - ||'''Command''' ||'''Explanation''' || + ||'''Syntax''' ||'''Explanation''' || - ||Insert ||<99%>'''Insert''' command inserts one row into the table with a value for specified column in the table.[[BR]][[BR]]~-''INSERT INTO table_name (colmn_name, ...)[[BR]]{{{ }}}VALUES ('value', ...)[[BR]]{{{ }}}WHERE row = 'row-key'[[BR]]{{{ }}}[TIMESTAMP 'timestamp'];''-~ || + ||Insert ||<99%>'''Insert''' syntax inserts one row into the table with a value for specified column in the table.[[BR]][[BR]]~-''INSERT INTO table_name (colmn_name, ...)[[BR]]{{{ }}}VALUES ('value', ...)[[BR]]{{{ }}}WHERE row = 'row-key'[[BR]]{{{ }}}[TIMESTAMP 'timestamp'];''-~ || - ||Delete ||'''Delete''' command deletes specified rows in table. [[BR]][[BR]]~-''DELETE { column_name, [, column_name] ... | COLUMNFAMILIES(column_family[, column_family] ... | *} [[BR]]{{{ }}}FROM table_name[[BR]]{{{ }}}[WHERE row = 'row-key'];''-~ || + ||Delete ||'''Delete''' syntax deletes specified rows in table. [[BR]][[BR]]~-''DELETE { column_name, [, column_name] ... | COLUMNFAMILIES(column_family[, column_family] ... | *} [[BR]]{{{ }}}FROM table_name[[BR]]{{{ }}}[WHERE row = 'row-key'];''-~ || - ||Select ||<99%>'''Select''' command retrieves rows from a table.[[BR]]Several aggregate operators: COUNT()[[BR]][[BR]]~-''SELECT { column_name [, column_name] ... | expr[alias] | * }[[BR]]{{{ }}}FROM table_name[[BR]]{{{ }}}[WHERE row = 'row-key' | STARTING FROM 'row-key' [UNTIL 'stop-key']][[BR]]{{{ }}}[NUM_VERSIONS = version_count][[BR]]{{{ }}}[TIMESTAMP 'timestamp'][[BR]]{{{ }}}[LIMIT = row_count][[BR]]{{{ }}}[INTO FILE 'file_name'][[BR]][[BR]]''-~'''column_name:'''~-''[[BR]]{{{ }}}column_family_name[[BR]]{{{ }}}| column_family_name:column_label_name''-~ || + ||Select ||<99%>'''Select''' syntax retrieves rows from a table.[[BR]]Several aggregate operators: COUNT()[[BR]][[BR]]~-''SELECT { column_name [, column_name] ... | expr[alias] | * }[[BR]]{{{ }}}FROM table_name[[BR]]{{{ }}}[WHERE row = 'row-key' | STARTING FROM 'row-key' [UNTIL 'stop-key']][[BR]]{{{ }}}[NUM_VERSIONS = version_count][[BR]]{{{ }}}[TIMESTAMP 'timestamp'][[BR]]{{{ }}}[LIMIT = row_count][[BR]]{{{ }}}[INTO FILE 'file_name'][[BR]][[BR]]''-~'''column_name:'''~-''[[BR]]{{{ }}}column_family_name[[BR]]{{{ }}}| column_family_name:column_label_name''-~ || - == Example Of HQL(Hbase Query Command) Uses == + == Example Of HQL Uses == === Create the table in a Hbase === {{{