Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 61BA9200AE2 for ; Fri, 27 May 2016 19:28:20 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6047B160A38; Fri, 27 May 2016 17:28:20 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A8BBC160A10 for ; Fri, 27 May 2016 19:28:19 +0200 (CEST) Received: (qmail 73234 invoked by uid 500); 27 May 2016 17:28:13 -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 72758 invoked by uid 99); 27 May 2016 17:28:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 May 2016 17:28:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 715D82C1F64 for ; Fri, 27 May 2016 17:28:13 +0000 (UTC) Date: Fri, 27 May 2016 17:28:13 +0000 (UTC) From: "Ashutosh Chauhan (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-13807) Extend metadata provider to pull up predicates through Union MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 27 May 2016 17:28:20 -0000 [ https://issues.apache.org/jira/browse/HIVE-13807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15304405#comment-15304405 ] Ashutosh Chauhan commented on HIVE-13807: ----------------------------------------- +1 > Extend metadata provider to pull up predicates through Union > ------------------------------------------------------------ > > Key: HIVE-13807 > URL: https://issues.apache.org/jira/browse/HIVE-13807 > Project: Hive > Issue Type: Sub-task > Components: CBO > Affects Versions: 2.1.0 > Reporter: Jesus Camacho Rodriguez > Assignee: Jesus Camacho Rodriguez > Attachments: HIVE-13807.patch > > > Follow-up of HIVE-13068. > Currently, when we pull up predicates through Union operation with Calcite metadata provider, we just create a single disjunction of pulled up predicates. > E.g. Assume operators _I1, I2, I3_ with predicates {{P1, P2, P3}} that can be pulled up through them, respectively. > For an operation _Union (I1, I2, I3)_ we infer a new predicate {{Pu}}, such that {{Pu = P1 OR P2 OR P3}}. > While this is correct, we miss some chances for simplification e.g. if there are common factors in P1, P2, and P3. Further, this inference differs slightly from the way that the metadata provider pulls up predicates for other operators (a list of predicates), thus breaking some assumptions and missing some optimization opportunities. > Ex. ql/src/test/results/clientpositive/input26.q.out > {noformat} > explain > select * from ( > select * from (select * from srcpart a where a.ds = '2008-04-08' and a.hr = '11' order by a.key limit 5)pa > union all > select * from (select * from srcpart b where b.ds = '2008-04-08' and b.hr = '14' limit 5)pb > )subq > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)