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 B81FBD98C for ; Mon, 21 Jan 2013 07:06:17 +0000 (UTC) Received: (qmail 46308 invoked by uid 500); 21 Jan 2013 07:06:16 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 45439 invoked by uid 500); 21 Jan 2013 07:06:15 -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 44796 invoked by uid 500); 21 Jan 2013 07:06:14 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 44783 invoked by uid 99); 21 Jan 2013 07:06:14 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jan 2013 07:06:14 +0000 Date: Mon, 21 Jan 2013 07:06:14 +0000 (UTC) From: "Phabricator (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-3464) Merging join tree may reorder joins which could be invalid 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-3464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13558577#comment-13558577 ] Phabricator commented on HIVE-3464: ----------------------------------- njain has commented on the revision "HIVE-3464 [jira] Merging join tree may reorder joins which could be invalid". INLINE COMMENTS ql/src/test/queries/clientpositive/mergejoins_mixed.q:19 I am totally confused. What is the diff. between the above query and the first query in (((a-b)-c)-d) ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java:6273 Can you write a small wiki/note on that explaining the correct behavior ? This is very difficult to review otherwise. REVISION DETAIL https://reviews.facebook.net/D5409 To: JIRA, navis Cc: njain > Merging join tree may reorder joins which could be invalid > ---------------------------------------------------------- > > Key: HIVE-3464 > URL: https://issues.apache.org/jira/browse/HIVE-3464 > Project: Hive > Issue Type: Bug > Components: Query Processor > Affects Versions: 0.10.0 > Reporter: Navis > Assignee: Navis > Attachments: HIVE-3464.D5409.2.patch, HIVE-3464.D5409.3.patch > > > Currently, hive merges join tree from right to left regardless of join types, which may introduce join reordering. For example, > select * from a join a b on a.key=b.key join a c on b.key=c.key join a d on a.key=d.key; > Hive tries to merge join tree in a-d=b-d, a-d=a-b, b-c=a-b order and a-d=a-b and b-c=a-b will be merged. Final join tree is "a-(bdc)". > With this, ab-d join will be executed prior to ab-c. But if join type of -c and -d is different, this is not valid. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira