Return-Path: X-Original-To: apmail-tajo-commits-archive@minotaur.apache.org Delivered-To: apmail-tajo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7A3B710CB9 for ; Wed, 4 Sep 2013 03:07:27 +0000 (UTC) Received: (qmail 48964 invoked by uid 500); 4 Sep 2013 03:07:26 -0000 Delivered-To: apmail-tajo-commits-archive@tajo.apache.org Received: (qmail 48938 invoked by uid 500); 4 Sep 2013 03:07:24 -0000 Mailing-List: contact commits-help@tajo.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tajo.incubator.apache.org Delivered-To: mailing list commits@tajo.incubator.apache.org Received: (qmail 48931 invoked by uid 99); 4 Sep 2013 03:07:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Sep 2013 03:07:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.131] (HELO eos.apache.org) (140.211.11.131) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Sep 2013 03:07:22 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 0109D271 for ; Wed, 4 Sep 2013 03:07:01 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Wed, 04 Sep 2013 03:07:01 -0000 Message-ID: <20130904030701.224.62173@eos.apache.org> Subject: =?utf-8?q?=5BTajo_Wiki=5D_Update_of_=22QueryLanguage=22_by_HyunsikChoi?= Auto-Submitted: auto-generated X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Tajo Wiki" for chan= ge notification. The "QueryLanguage" page has been changed by HyunsikChoi: https://wiki.apache.org/tajo/QueryLanguage?action=3Ddiff&rev1=3D2&rev2=3D3 Comment: INSERT OVERWRITE statement is added. + =3D=3D Data Types =3D=3D + Tajo provides SQL data types. TajoDataTypes describes the detailed data t= ypes. - =3D=3D Primitive types =3D=3D - * 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 - = = =3D=3D DDL =3D=3D =3D=3D=3D CREATE TABLE =3D=3D=3D @@ -44, +35 @@ [ORDER BY [ASC|DESC] [NULL FIRST|NULL LAST] [, ...]] }}} = - (still working) + =3D=3D=3D INSERT =3D=3D=3D = + Tajo provides INSERT OVERWRITE statement like Hive. Tajo's INSERT OVERWRI= TE statement follows 'INSERT INTO SELECT' statement of SQL. The examples ar= e as follows: + = + {{{ + create table t1 (col1 int8, col2 int4, col3 float4); + = + -- when a target table schema and output schema are equivalent to each ot= her + insert overwrite into t1 select l_orderkey, l_partkey, l_quantity from li= neitem; + -- 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_quantit= y FROM lineitem; + }}} +=20