Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 09AF518467 for ; Wed, 13 Jan 2016 09:42:40 +0000 (UTC) Received: (qmail 29026 invoked by uid 500); 13 Jan 2016 09:42:40 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 29000 invoked by uid 500); 13 Jan 2016 09:42:39 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 28985 invoked by uid 99); 13 Jan 2016 09:42:39 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jan 2016 09:42:39 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C3F212C03DA for ; Wed, 13 Jan 2016 09:42:39 +0000 (UTC) Date: Wed, 13 Jan 2016 09:42:39 +0000 (UTC) From: "Lefty Leverenz (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-11634) Support partition pruning for IN(STRUCT(partcol, nonpartcol..)...) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-11634?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15095887#comment-15095887 ] Lefty Leverenz commented on HIVE-11634: --------------------------------------- [~hsubramaniyan], did this ever get committed to 1.3.0? I don't see the commit and besides, the parameter deletion isn't applicable. > Support partition pruning for IN(STRUCT(partcol, nonpartcol..)...) > ------------------------------------------------------------------ > > Key: HIVE-11634 > URL: https://issues.apache.org/jira/browse/HIVE-11634 > Project: Hive > Issue Type: Bug > Components: CBO > Reporter: Hari Sankar Sivarama Subramaniyan > Assignee: Hari Sankar Sivarama Subramaniyan > Labels: TODOC1.3 > Fix For: 1.3.0 > > Attachments: HIVE-11634.1.patch, HIVE-11634.2.patch, HIVE-11634.3.patch, HIVE-11634.4.patch, HIVE-11634.5.patch, HIVE-11634.6.patch, HIVE-11634.7.patch, HIVE-11634.8.patch, HIVE-11634.9.patch, HIVE-11634.91.patch, HIVE-11634.92.patch, HIVE-11634.93.patch, HIVE-11634.94.patch, HIVE-11634.95.patch, HIVE-11634.96.patch, HIVE-11634.97.patch, HIVE-11634.98.patch, HIVE-11634.99.patch, HIVE-11634.990.patch, HIVE-11634.991.patch, HIVE-11634.992.patch, HIVE-11634.993.patch, HIVE-11634.994.patch, HIVE-11634.995.patch, HIVE-11634.patch > > > Currently, we do not support partition pruning for the following scenario > {code} > create table pcr_t1 (key int, value string) partitioned by (ds string); > insert overwrite table pcr_t1 partition (ds='2000-04-08') select * from src where key < 20 order by key; > insert overwrite table pcr_t1 partition (ds='2000-04-09') select * from src where key < 20 order by key; > insert overwrite table pcr_t1 partition (ds='2000-04-10') select * from src where key < 20 order by key; > explain extended select ds from pcr_t1 where struct(ds, key) in (struct('2000-04-08',1), struct('2000-04-09',2)); > {code} > If we run the above query, we see that all the partitions of table pcr_t1 are present in the filter predicate where as we can prune partition (ds='2000-04-10'). > The optimization is to rewrite the above query into the following. > {code} > explain extended select ds from pcr_t1 where (struct(ds)) IN (struct('2000-04-08'), struct('2000-04-09')) and struct(ds, key) in (struct('2000-04-08',1), struct('2000-04-09',2)); > {code} > The predicate (struct(ds)) IN (struct('2000-04-08'), struct('2000-04-09')) is used by partition pruner to prune the columns which otherwise will not be pruned. > This is an extension of the idea presented in HIVE-11573. -- This message was sent by Atlassian JIRA (v6.3.4#6332)