Return-Path: Delivered-To: apmail-hadoop-hive-dev-archive@minotaur.apache.org Received: (qmail 62699 invoked from network); 21 Dec 2009 19:19:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Dec 2009 19:19:41 -0000 Received: (qmail 30379 invoked by uid 500); 21 Dec 2009 19:19:41 -0000 Delivered-To: apmail-hadoop-hive-dev-archive@hadoop.apache.org Received: (qmail 30354 invoked by uid 500); 21 Dec 2009 19:19:40 -0000 Mailing-List: contact hive-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hadoop.apache.org Delivered-To: mailing list hive-dev@hadoop.apache.org Received: (qmail 30341 invoked by uid 99); 21 Dec 2009 19:19:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Dec 2009 19:19:40 +0000 X-ASF-Spam-Status: No, hits=-1999.6 required=10.0 tests=ALL_TRUSTED,SUBJECT_FUZZY_TION X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Dec 2009 19:19:39 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 22817234C045 for ; Mon, 21 Dec 2009 11:19:18 -0800 (PST) Message-ID: <1451922066.1261423158132.JavaMail.jira@brutus> Date: Mon, 21 Dec 2009 19:19:18 +0000 (UTC) From: "Zheng Shao (JIRA)" To: hive-dev@hadoop.apache.org Subject: [jira] Commented: (HIVE-936) dynamic partitions creation based on values In-Reply-To: <631937376.1258421979564.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HIVE-936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793306#action_12793306 ] Zheng Shao commented on HIVE-936: --------------------------------- Another case not covered by previous discussions (copied from HIVE-1002): {code} CREATE TABLE (a STRING, b STRING, c STRING) PARTITIONED BY (ds STRING, ts STRING); INSERT OVERWRITE TABLE x PARTITION (ds = '2009-12-12') SELECT a, b, c, ts FROM xxx; {code} Basically, allowing users to overwrite multiple partitions at a time. The partition values specified in PARTITION part (if any) should be a prefix of the partition keys (to simply implementation). The rest of the partition keys goes to the end of the SELECT expression list. This query will remove any existing partitions of ds = '2009-12-12' (and any ts value), and create partitions with ds = '2009-12-12' and ts of dynamical values. > dynamic partitions creation based on values > ------------------------------------------- > > Key: HIVE-936 > URL: https://issues.apache.org/jira/browse/HIVE-936 > Project: Hadoop Hive > Issue Type: New Feature > Reporter: Ning Zhang > Assignee: Ning Zhang > > If a Hive table is created as partitioned, DML could only inserted into one partitioin per query. Ideally partitions should be created on the fly based on the value of the partition columns. As an example: > {{{ > create table T (a int, b string) partitioned by (ds string); > insert overwrite table T select a, b, ds from S where ds >= '2009-11-01' and ds <= '2009-11-16'; > }}} > should be able to execute in one DML rather than possibley 16 DML for each distinct ds values. CTAS and alter table should be able to do the same thing: > {{{ > create table T partitioned by (ds string) as select * from S where ds >= '2009-11-01' and ds <= '2009-11-16'; > }}} > and > {{{ > create table T(a int, b string, ds string); > insert overwrite table T select * from S where ds >= '2009-11-1' and ds <= '2009-11-16'; > alter table T partitioned by (ds); > }}} > should all return the same results. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.