Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C52699AA3 for ; Wed, 10 Dec 2014 20:49:13 +0000 (UTC) Received: (qmail 15751 invoked by uid 500); 10 Dec 2014 20:49:12 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 15659 invoked by uid 500); 10 Dec 2014 20:49:12 -0000 Mailing-List: contact dev-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 dev@hive.apache.org Received: (qmail 15645 invoked by uid 500); 10 Dec 2014 20:49:12 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 15642 invoked by uid 99); 10 Dec 2014 20:49:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Dec 2014 20:49:12 +0000 Date: Wed, 10 Dec 2014 20:49:12 +0000 (UTC) From: "Chao (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-9041) Generate better plan for queries containing both union and multi-insert [Spark Branch] 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-9041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Chao updated HIVE-9041: ----------------------- Issue Type: Sub-task (was: Bug) Parent: HIVE-7292 > Generate better plan for queries containing both union and multi-insert [Spark Branch] > -------------------------------------------------------------------------------------- > > Key: HIVE-9041 > URL: https://issues.apache.org/jira/browse/HIVE-9041 > Project: Hive > Issue Type: Sub-task > Components: Spark > Affects Versions: spark-branch > Reporter: Chao > > This is a follow-up for HIVE-8920. For queries like: > {code} > from (select * from table0 union all select * from table1) s > insert overwrite table table3 select s.x, count(1) group by s.x > insert overwrite table table4 select s.y, count(1) group by s.y; > {code} > Currently we generate the following plan: > {noformat} > M1 M2 > \ / \ > U3 R5 > | > R4 > {noformat} > It's better, however, to have the following plan: > {noformat} > M1 M2 > |\ /| > | \/ | > | /\ | > R4 R5 > {noformat} > Also, we can do some reseach in this JIRA to see if it's possible > to remove UnionWork once and for all. -- This message was sent by Atlassian JIRA (v6.3.4#6332)