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 9C609200CB5 for ; Wed, 12 Jul 2017 09:59:49 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9917F1683AA; Wed, 12 Jul 2017 07:59:49 +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 DE8731683A3 for ; Wed, 12 Jul 2017 09:59:48 +0200 (CEST) Received: (qmail 93211 invoked by uid 500); 12 Jul 2017 07:59:47 -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 93202 invoked by uid 99); 12 Jul 2017 07:59:47 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jul 2017 07:59:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 41AB0195836 for ; Wed, 12 Jul 2017 07:59:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id zb4gY-kDNqK4 for ; Wed, 12 Jul 2017 07:59:44 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4C97562657 for ; Wed, 12 Jul 2017 07:59:06 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 05925E0D89 for ; Wed, 12 Jul 2017 07:59:05 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 6C1D2246FE for ; Wed, 12 Jul 2017 07:59:02 +0000 (UTC) Date: Wed, 12 Jul 2017 07:59:02 +0000 (UTC) From: "Chao Sun (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-17018) Small table is converted to map join even the total size of small tables exceeds the threshold(hive.auto.convert.join.noconditionaltask.size) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 12 Jul 2017 07:59:49 -0000 [ https://issues.apache.org/jira/browse/HIVE-17018?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1608= 3610#comment-16083610 ]=20 Chao Sun commented on HIVE-17018: --------------------------------- [~kellyzly] Yes. I think we don't need to change the existing behavior. I'm= just suggesting that we might need a HoS specific config to replace {{hive= .auto.convert.join.nonconditionaltask.size}}, so that it is less confusing. > Small table is converted to map join even the total size of small tables = exceeds the threshold(hive.auto.convert.join.noconditionaltask.size) > -------------------------------------------------------------------------= -------------------------------------------------------------------- > > Key: HIVE-17018 > URL: https://issues.apache.org/jira/browse/HIVE-17018 > Project: Hive > Issue Type: Bug > Reporter: liyunzhang_intel > Assignee: liyunzhang_intel > Attachments: HIVE-17018_data_init.q, HIVE-17018.q, t3.txt > > > we use "hive.auto.convert.join.noconditionaltask.size" as the threshold.= it means the sum of size for n-1 of the tables/partitions for a n-way joi= n is smaller than it, it will be converted to a map join. for example, A jo= in B join C join D join E. Big table is A(100M), small tables are B(10M),C(= 10M),D(10M),E(10M). If we set hive.auto.convert.join.noconditionaltask.siz= e=3D20M. In current code, E,D,B will be converted to map join but C will no= t be converted to map join. In my understanding, because hive.auto.convert.= join.noconditionaltask.size can only contain E and D, so C and B should not= be converted to map join. =20 > Let's explain more why E can be converted to map join. > in current code, [SparkMapJoinOptimizer#getConnectedMapJoinSize|https://g= ithub.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/opt= imizer/spark/SparkMapJoinOptimizer.java#L364] calculates all the mapjoins = in the parent path and child path. The search stops when encountering [Unio= nOperator or ReduceOperator|https://github.com/apache/hive/blob/master/ql/s= rc/java/org/apache/hadoop/hive/ql/optimizer/spark/SparkMapJoinOptimizer.jav= a#L381]. Because C is not converted to map join because {{connectedMapJoinS= ize + totalSize) > maxSize}} [see code|https://github.com/apache/hive/blob/= master/ql/src/java/org/apache/hadoop/hive/ql/optimizer/spark/SparkMapJoinOp= timizer.java#L330].The RS before the join of C remains. When calculating wh= ether B will be converted to map join, {{getConnectedMapJoinSize}} returns = 0 as encountering [RS |https://github.com/apache/hive/blob/master/ql/src/ja= va/org/apache/hadoop/hive/ql/optimizer/spark/SparkMapJoinOptimizer.java#409= ] and causes {{connectedMapJoinSize + totalSize) < maxSize}} matches. > [~xuefuz] or [~jxiang]: can you help see whether this is a bug or not as= you are more familiar with SparkJoinOptimizer. -- This message was sent by Atlassian JIRA (v6.4.14#64029)