Return-Path: Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: (qmail 65408 invoked from network); 16 Apr 2010 19:15:42 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Apr 2010 19:15:42 -0000 Received: (qmail 83857 invoked by uid 500); 16 Apr 2010 19:15:41 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 83754 invoked by uid 500); 16 Apr 2010 19:15:40 -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 83747 invoked by uid 500); 16 Apr 2010 19:15:40 -0000 Delivered-To: apmail-hadoop-core-commits@hadoop.apache.org Received: (qmail 83744 invoked by uid 99); 16 Apr 2010 19:15:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Apr 2010 19:15:40 +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; Fri, 16 Apr 2010 19:15:38 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 444D816E29; Fri, 16 Apr 2010 19:15:17 +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: Fri, 16 Apr 2010 19:15:17 -0000 Message-ID: <20100416191517.16036.55233@eos.apache.org> Subject: =?utf-8?q?=5BHadoop_Wiki=5D_Update_of_=22Hive/Tutorial=22_by_Ning_Zhang?= 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/Tutorial" page has been changed by Ning Zhang. http://wiki.apache.org/hadoop/Hive/Tutorial?action=3Ddiff&rev1=3D21&rev2=3D= 22 -------------------------------------------------- * An additional pvs.country column is added in the select statement. Th= is is the corresponding input column for the dynamic partition column. Note= that you do not need to add an input column for the static partition colum= n because its value is already known in the PARTITION clause. = = Semantics of the dynamic partition insert statement: + * When there are already non-empty partitions exists for the dynamic pa= rtition columns, (e.g., country=3D'CA' exists under some ds root partition)= , it will be overwritten if the dynamic partition insert saw the same value= (say 'CA') in the input data. This is in line with the 'insert overwrite' = semantics. However, if the partition value 'CA' does not appear in the inpu= t data, the existing partition will not be overwritten. = * Since a Hive partition corresponds to a directory in HDFS, the partit= ion value has to conform to the HDFS path format (URI in Java). Any charact= er having a special meaning in URI (e.g., '%', ':', '/', '#') will be escap= ed with '%' followed by 2 bytes of its ASCII value. = * If the input column is a type different than STRING, its value will b= e first converted to STRING to be used to construct the HDFS path. = * If the input column value is NULL or empty string, the row will be pu= t into a special partition, whose name is controlled by the hive parameter = hive.exec.default.dynamic.partition.name. The default value is __HIVE_DEFAU= LT_PARTITION__. Basically this partition will contain all "bad" rows whose = value are not valid partition names. The caveat of this approach is that th= e bad value will be lost and is replaced by __HIVE_DEFAULT_PARTITION__ if y= ou select them Hive. JIRA HIVE-1309 is a solution to let user specify "bad = file" to retain the input partition column values as well.