From common-commits-return-11474-apmail-hadoop-common-commits-archive=hadoop.apache.org@hadoop.apache.org Sat Jul 10 02:30:35 2010 Return-Path: Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: (qmail 83379 invoked from network); 10 Jul 2010 02:30:35 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 10 Jul 2010 02:30:35 -0000 Received: (qmail 85756 invoked by uid 500); 10 Jul 2010 02:30:34 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 85709 invoked by uid 500); 10 Jul 2010 02:30:34 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 85702 invoked by uid 500); 10 Jul 2010 02:30:33 -0000 Delivered-To: apmail-hadoop-core-commits@hadoop.apache.org Received: (qmail 85699 invoked by uid 99); 10 Jul 2010 02:30:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Jul 2010 02:30:33 +0000 X-ASF-Spam-Status: No, hits=-2000.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; Sat, 10 Jul 2010 02:30:31 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id C1F4217D1D; Sat, 10 Jul 2010 02:29:39 +0000 (GMT) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Sat, 10 Jul 2010 02:29:39 -0000 Message-ID: <20100710022939.10218.45065@eos.apache.org> Subject: =?utf-8?q?=5BHadoop_Wiki=5D_Update_of_=22Hive/LanguageManual/DDL=22_by_Jo?= =?utf-8?q?hnSichi?= X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for ch= ange notification. The "Hive/LanguageManual/DDL" page has been changed by JohnSichi. http://wiki.apache.org/hadoop/Hive/LanguageManual/DDL?action=3Ddiff&rev1=3D= 65&rev2=3D66 -------------------------------------------------- [COMMENT table_comment] [PARTITIONED BY (col_name data_type [COMMENT col_comment], ...)] [CLUSTERED BY (col_name, col_name, ...) [SORTED BY (col_name [ASC|DESC]= , ...)] INTO num_buckets BUCKETS] - [ROW FORMAT row_format] + [ + [ROW FORMAT row_format] [STORED AS file_format] + | STORED BY 'storage.handler.class.name' [ WITH SERDEPROPERTIES (...) = ] (Note: only available starting with 0.6.0) + ] [STORED AS file_format] [LOCATION hdfs_path] - [TBLPROPERTIES (property_name=3Dproperty_value, ...)] (Note: only ava= ilable on latest trunk or versions higher than 0.5.0) + [TBLPROPERTIES (property_name=3Dproperty_value, ...)] (Note: only ava= ilable starting with 0.6.0) - [AS select_statement] (Note: this feature is only available on the lat= est trunk or versions higher than 0.4.0.) + [AS select_statement] (Note: this feature is only available starting w= ith 0.5.0.) = CREATE [EXTERNAL] TABLE [IF NOT EXISTS] table_name LIKE existing_table_name @@ -58, +61 @@ | TEXTFILE | INPUTFORMAT input_format_classname OUTPUTFORMAT output_format_classna= me }}} + = CREATE TABLE creates a table with the given name. An error is thrown if a= table or view with the same name already exists. You can use IF NOT EXISTS= to skip the error. = The EXTERNAL keyword lets you create a table and provide a LOCATION so th= at Hive does not use a default location for this table. This comes in handy= if you already have data generated. When dropping an EXTERNAL table, data = in the table is NOT deleted from the file system. @@ -69, +73 @@ You must specify a list of a columns for tables that use a native SerDe. = Refer to the Types part of the User Guide for the allowable column types. A= list of columns for tables that use a custom SerDe may be specified but Hi= ve will query the SerDe to determine the actual list of columns for this ta= ble. = Use STORED AS TEXTFILE if the data needs to be stored as plain text files= . Use STORED AS SEQUENCEFILE if the data needs to be compressed. Please rea= d more about [[Hive/CompressedStorage]] if you are planning to keep data co= mpressed in your Hive tables. Use INPUTFORMAT and OUTPUTFORMAT to specify = the name of a corresponding InputFormat and OutputFormat class as a string = literal, e.g. 'org.apache.hadoop.hive.contrib.fileformat.base64.Base64TextI= nputFormat'. + = + Use STORED BY to create a non-native table, for example in HBase. See [[= Hive/StorageHandlers]] for more information on this option. = Partitioned tables can be created using the PARTITIONED BY clause. A tabl= e can have one or more partition columns and a separate data directory is c= reated for each distinct value combination in the partition columns. Furthe= r, tables or partitions can be bucketed using CLUSTERED BY columns, and dat= a can be sorted within that bucket via SORT BY columns. This can improve pe= rformance on certain kinds of queries. =20