You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by Apache Wiki <wi...@apache.org> on 2007/08/09 07:54:07 UTC
[Lucene-hadoop Wiki] Trivial Update of "Hbase/HbaseShell/HQL" by InchulSong
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 InchulSong:
http://wiki.apache.org/lucene-hadoop/Hbase/HbaseShell/HQL
The comment on the change is:
a slight refinment to the HQL syntax
------------------------------------------------------------------------------
without using programming APIs.
We borrowed the syntax definition style from MySQL.
+
''Thanks to Edward Yoon for his initial idea of HQL, and to Stack for his valuable suggestions.''
@@ -72, +73 @@
SELECT { column_name, ... | * }
FROM table_name
[WHERE row = 'row-key' | STARTING FROM 'row-key']
- [NUM_VERSIONS = version_count ]
+ [NUM_VERSIONS = version_count]
[TIMESTAMP 'timestamp']
[LIMIT = row_count]
- [INTO OUTFILE 'file_name' export_options]
+ [INTO FILE 'file_name' options]
column_name:
column_family_name:column_label_name
| column_family_name:
+
+ options:
+ FIELDS DELIMITED BY 'string' [ENCLOSED BY 'char']
}}}
* You should quote column_name with single quotes if column_name has spaces in it.
@@ -94, +98 @@
* LIMIT limits the number of rows to be returned.
- * INTO OUTFILE outputs the returned rows into a specified file. See LOAD DATA INFILE below for export_options. For inserting into another table, see INSERT INTO SELECT below.
+ * INTO FILE outputs the returned rows into a specified file. options specifies how to delimit each field in the file. For SELECT INTO another table, see INSERT below.
''~- "add some row filtering here, i.g., regex match or upper limit on rows returned." -~'' by Stack. See issue [https://issues.apache.org/jira/browse/HADOOP-1611 HADOOP-1611].
@@ -113, +117 @@
* If TIMESTAMP is not specified, the current time is used as the value of the timestamp key.
{{{
- INSERT INTO table_name (colmn_name, ...)
+ INSERT INTO table_name (column_name, ...)
[TIMESTAMP 'timestamp']
SELECT ...
}}}
@@ -129, +133 @@
WHERE row = 'row-key'
}}}
- === LOAD DATA INFILE Syntax ===
+ === LOAD FROM FILE Syntax ===
- LOAD DATA INFILE reads rows from a file and inserts these rows into a table.
+ LOAD FROM FILE reads rows from a file and inserts these rows into a table.
{{{
- LOAD DATA INFILE 'file_name'
+ LOAD FROM FILE 'file_name'
INTO TABLE table_name
- [export_options]
+ [options]
-
- export_options:
- [FIELDS
- [TERMINATED BY 'string']
- [ENCLOSED BY 'char']
- ]
- [LINES
- [STARTING BY 'string']
- [TERMINATED BY 'string']
- ]
}}}
- * LOAD DATA INFILE is complement of SELECT INTO OUTFILE.
+ * LOAD FROM FILE is complement of SELECT INTO FILE.
+
-
- * export_options tells LOAD DATA INFILE how to parse the input file, such as how each field or line is separated from each other.
-
=== START TRANSACTION, COMMIT, and ROLLBACK Syntax ===
You can group togather a sequence of data manipulation statements in a single-row transaction.