Return-Path: Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: (qmail 11661 invoked from network); 1 Feb 2011 20:49:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Feb 2011 20:49:20 -0000 Received: (qmail 34583 invoked by uid 500); 1 Feb 2011 20:49:20 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 34319 invoked by uid 500); 1 Feb 2011 20:49:19 -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 34304 invoked by uid 500); 1 Feb 2011 20:49:19 -0000 Delivered-To: apmail-hadoop-core-commits@hadoop.apache.org Received: (qmail 34299 invoked by uid 99); 1 Feb 2011 20:49:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 20:49:19 +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; Tue, 01 Feb 2011 20:49:18 +0000 Received: from eosnew.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id E25045DB; Tue, 1 Feb 2011 20:48:50 +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: Tue, 01 Feb 2011 20:48:50 -0000 Message-ID: <20110201204850.50909.87620@eosnew.apache.org> Subject: =?utf-8?q?=5BHadoop_Wiki=5D_Update_of_=22Hive/PartitionedViews=22_by_John?= =?utf-8?q?Sichi?= Dear Wiki user, You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for ch= ange notification. The "Hive/PartitionedViews" page has been changed by JohnSichi. http://wiki.apache.org/hadoop/Hive/PartitionedViews?action=3Ddiff&rev1=3D2&= rev2=3D3 -------------------------------------------------- 1. One possible approach mentioned in [[https://issues.apache.org/jira/b= rowse/HIVE-1079|HIVE-1079]] is to infer view partitions automatically based= on the partitions of the underlying tables. A command such as SHOW PARTIT= IONS could then synthesize virtual partition descriptors on the fly. This = is fairly easy to do for use case #1, but potentially very difficult for us= e cases #2 and #3. So for now, we are punting on this approach. 1. Instead, we will require users to explicitly declare view partitionin= g as part of CREATE VIEW, and explicitly manage partition metadata via ALTE= R VIEW {ADD|DROP} PARTITION. This allows all of the use cases to be satisf= ied (while placing more burden on the user, and taking up more metastore sp= ace). = + =3D Syntax =3D + = + {{{ + CREATE VIEW [IF NOT EXISTS] view_name [ (column_name [COMMENT column_comm= ent], ...) ] + [COMMENT table_comment] + [ PARTITIONED ON (col1, col2, ...) ] + [ TBLPROPERTIES ... ] + AS SELECT ... + = + ALTER VIEW view_name ADD [IF NOT EXISTS] partition_spec partition_spec ... + = + ALTER VIEW view_name DROP [IF EXISTS] partition_spec, partition_spec, ... + = + partition_spec: + : PARTITION (partition_col =3D partition_col_value, partition_col =3D p= artiton_col_value, ...) + }}} + = + Notes: + = + * Whereas CREATE TABLE uses PARTITIONED BY, CREATE VIEW uses PARTITIONED= ON. This difference is intentional because in CREATE TABLE, the PARTITION= ED BY clause specifies additional column definitions which are appended to = the non-partitioning columns. With CREATE VIEW, the PARTITIONED ON clause = references (by name) columns already produced by the view definition. Only= column names appear in PARTITIONED ON; no types etc. However, to match th= e CREATE TABLE convention of trailing partitioning columns, the columns ref= erenced by the PARTITIONED ON clause must be the last columns in the view d= efinition, and their order in the PARTITIONED ON clause must match their or= der in the view definition. + * The ALTER VIEW ADD/DROP partition syntax is identical to ALTER TABLE, = except that it is illegal to specify a LOCATION clause. + * Other ALTER TABLE commands which operate on partitions (e.g. TOUCH/ARC= HIVE) are not supported. (But maybe we need to support TOUCH?) +=20