tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Tajo Wiki] Update of "QueryLanguage" by HyunsikChoi
Date Wed, 04 Sep 2013 03:07:01 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tajo Wiki" for change notification.

The "QueryLanguage" page has been changed by HyunsikChoi:
https://wiki.apache.org/tajo/QueryLanguage?action=diff&rev1=2&rev2=3

Comment:
INSERT OVERWRITE statement is added.

+ == Data Types ==
+ Tajo provides SQL data types. TajoDataTypes describes the detailed data types.
- == Primitive types ==
-  * byte - 1 byte value
-  * bool - boolean value (1 byte)
-  * short - 2 byte integer
-  * int - 4 byte integer
-  * long - 8 byte integer
-  * float - single precision (4 byte)
-  * double - double precision (8 byte)
-  * bytes
-  * string - sequence of characters in UTF-8
- 
  
  == DDL ==
  === CREATE TABLE ===
@@ -44, +35 @@

    [ORDER BY <expression> [ASC|DESC] [NULL FIRST|NULL LAST] [, ...]]
  }}}
  
- (still working)
+ === INSERT ===
  
+ Tajo provides INSERT OVERWRITE statement like Hive. Tajo's INSERT OVERWRITE statement follows
'INSERT INTO SELECT' statement of SQL. The examples are as follows:
+ 
+ {{{
+ create table t1 (col1 int8, col2 int4, col3 float4);
+ 
+ -- when a target table schema and output schema are equivalent to each other
+ insert overwrite into t1 select l_orderkey, l_partkey, l_quantity from lineitem;
+ -- or
+ INSERT OVERWRITE INTO t1 select * FROM lineitem;
+ 
+ -- when the output schema are smaller than the target table schema
+ INSERT OVERWRITE INTO t1 SELECT l_orderkey FROM lineitem;
+ 
+ -- when you want to specify certain target columns
+ INSERT OVERWRITE INTO t1 (col1, col3) SELECT l_orderkey, l_quantity FROM lineitem;
+ }}}
+ 
+ In addition, INSERT OVERWRITE statement overwrites table data as well as a specific directory.
+ 
+ {{{
+ INSERT OVERWRITE INTO LOCATION '/dir/subdir' SELECT l_orderkey, l_quantity FROM lineitem;
+ }}}
+ 

Mime
View raw message