可以執行以下指令進到HQL指令模式,可以試試看
$ bin/hbase shell
Hbase Shell, 0.0.2 version.
Copyright (c) 2007 by udanax, licensed to Apache Software Foundation.
Type 'help;' for usage.
hql > help;
Type 'help COMMAND;' to see command-specific usage.
+-------------------------+-------------------------+-------------------------+
| Command | Description | Example |
+-------------------------+-------------------------+-------------------------+
| EXIT | Exit shell | EXIT; |
+-------------------------+-------------------------+-------------------------+
| ALTER | Alter structure of table| ALTER TABLE table_name A|
| | | DD column_spec | ADD (co|
| | | lumn_spec, column_spec, |
| | | ...) | CHANGE column_fam|
| | | ily column_spec | DROP c|
| | | olumn_family_name | CHAN|
| | | GE column_spec; |
+-------------------------+-------------------------+-------------------------+
| CREATE | Create tables | CREATE TABLE table_name |
| | | (column_family_name [MAX|
| | | _VERSIONS=n] [MAX_LENGTH|
| | | =n] [COMPRESSION=NONE|RE|
| | | CORD|BLOCK] [IN_MEMORY] |
| | | [BLOOMFILTER=NONE|BLOOMF|
| | | ILTER|COUNTING_BLOOMFILT|
| | | ER|RETOUCHED_BLOOMFILTER|
| | | VECTOR_SIZE=n NUM_HASH=|
| | | n], ...) |
+-------------------------+-------------------------+-------------------------+
| INSERT | Insert values into table| INSERT INTO table_name (|
| | | column_name, ...) VALUES|
| | | ('value', ...) WHERE ro|
| | | w='row_key' [TIMESTAMP '|
| | | timestamp']; |
+-------------------------+-------------------------+-------------------------+
| DROP | Drop tables | DROP TABLE table_name [,|
| | | table_name] ...; |
+-------------------------+-------------------------+-------------------------+
| TRUNCATE | Truncate table is used t| TRUNCATE TABLE table_nam|
| | o clean all data from a | e; |
| | table | |
+-------------------------+-------------------------+-------------------------+
| DESCRIBE | Print table information | [DESCRIBE|DESC] table_na|
| | | me; |
+-------------------------+-------------------------+-------------------------+
| JAR | Hadoop RunJar util | JAR jarFile [mainClass] |
| | | arguments...; |
+-------------------------+-------------------------+-------------------------+
| FS | Hadoop FsShell; entering| FS [-option] arguments..|
| | a lone 'FS;' will emit | ; |
| | usage | |
+-------------------------+-------------------------+-------------------------+
| DELETE | Delete table data | DELETE {column_name, [, |
| | | column_name] ... | *} FR|
| | | OM table_name WHERE row=|
| | | 'row-key'; |
+-------------------------+-------------------------+-------------------------+
| SELECT | Select values from table| SELECT {column_name, [, |
| | | column_name] ... | expr[|
| | | alias] | * } FROM table_|
| | | name [WHERE row='row_key|
| | | ' | STARTING FROM 'row-k|
| | | ey' [UNTIL 'stop-key']] |
| | | [NUM_VERSIONS = version_|
| | | count] [TIMESTAMP 'times|
| | | tamp'] [LIMIT = row_coun|
| | | t] [INTO FILE 'file_name|
| | | ']; |
+-------------------------+-------------------------+-------------------------+
| SHOW | Show information about s| SHOW TABLES [or substitu|
| | elected title | tion variable name]; |
+-------------------------+-------------------------+-------------------------+
| CLEAR | Clear the screen | CLEAR; |
+-------------------------+-------------------------+-------------------------+
hql > help;
Type 'help COMMAND;' to see command-specific usage.
+-------------------------+-------------------------+-------------------------+
| Command | Description | Example |
+-------------------------+-------------------------+-------------------------+
| EXIT | Exit shell | EXIT; |
+-------------------------+-------------------------+-------------------------+
| ALTER | Alter structure of table| ALTER TABLE table_name A|
| | | DD column_spec | ADD (co|
| | | lumn_spec, column_spec, |
| | | ...) | CHANGE column_fam|
| | | ily column_spec | DROP c|
| | | olumn_family_name | CHAN|
| | | GE column_spec; |
+-------------------------+-------------------------+-------------------------+
| CREATE | Create tables | CREATE TABLE table_name |
| | | (column_family_name [MAX|
| | | _VERSIONS=n] [MAX_LENGTH|
| | | =n] [COMPRESSION=NONE|RE|
| | | CORD|BLOCK] [IN_MEMORY] |
| | | [BLOOMFILTER=NONE|BLOOMF|
| | | ILTER|COUNTING_BLOOMFILT|
| | | ER|RETOUCHED_BLOOMFILTER|
| | | VECTOR_SIZE=n NUM_HASH=|
| | | n], ...) |
+-------------------------+-------------------------+-------------------------+
| INSERT | Insert values into table| INSERT INTO table_name (|
| | | column_name, ...) VALUES|
| | | ('value', ...) WHERE ro|
| | | w='row_key' [TIMESTAMP '|
| | | timestamp']; |
+-------------------------+-------------------------+-------------------------+
| DROP | Drop tables | DROP TABLE table_name [,|
| | | table_name] ...; |
+-------------------------+-------------------------+-------------------------+
| TRUNCATE | Truncate table is used t| TRUNCATE TABLE table_nam|
| | o clean all data from a | e; |
| | table | |
+-------------------------+-------------------------+-------------------------+
| DESCRIBE | Print table information | [DESCRIBE|DESC] table_na|
| | | me; |
+-------------------------+-------------------------+-------------------------+
| JAR | Hadoop RunJar util | JAR jarFile [mainClass] |
| | | arguments...; |
+-------------------------+-------------------------+-------------------------+
| FS | Hadoop FsShell; entering| FS [-option] arguments..|
| | a lone 'FS;' will emit | ; |
| | usage | |
+-------------------------+-------------------------+-------------------------+
| DELETE | Delete table data | DELETE {column_name, [, |
| | | column_name] ... | *} FR|
| | | OM table_name WHERE row=|
| | | 'row-key'; |
+-------------------------+-------------------------+-------------------------+
| SELECT | Select values from table| SELECT {column_name, [, |
| | | column_name] ... | expr[|
| | | alias] | * } FROM table_|
| | | name [WHERE row='row_key|
| | | ' | STARTING FROM 'row-k|
| | | ey' [UNTIL 'stop-key']] |
| | | [NUM_VERSIONS = version_|
| | | count] [TIMESTAMP 'times|
| | | tamp'] [LIMIT = row_coun|
| | | t] [INTO FILE 'file_name|
| | | ']; |
+-------------------------+-------------------------+-------------------------+
| SHOW | Show information about s| SHOW TABLES [or substitu|
| | elected title | tion variable name]; |
+-------------------------+-------------------------+-------------------------+
| CLEAR | Clear the screen | CLEAR; |
+-------------------------+-------------------------+-------------------------+
hql >