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 DE5CC10CC8 for ; Wed, 4 Dec 2013 01:45:36 +0000 (UTC) Received: (qmail 45124 invoked by uid 500); 4 Dec 2013 01:45:36 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 45077 invoked by uid 500); 4 Dec 2013 01:45:36 -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 45068 invoked by uid 500); 4 Dec 2013 01:45:36 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 45064 invoked by uid 99); 4 Dec 2013 01:45:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Dec 2013 01:45:36 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sukhendu.chakraborty@gmail.com designates 209.85.192.174 as permitted sender) Received: from [209.85.192.174] (HELO mail-pd0-f174.google.com) (209.85.192.174) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Dec 2013 01:45:31 +0000 Received: by mail-pd0-f174.google.com with SMTP id y13so21134390pdi.5 for ; Tue, 03 Dec 2013 17:45:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=eHyiYkFhlNE9YXiXH8FNxm8+dM/lt22P9qmIEOwCuAg=; b=SWdzKhq8ZwKTdyIPylbfuuaFd0+L/CW3r3M61EYN4te+g7XDpw3wVfLRdR3ZvhsD/o T7Yu4iggkNE5q2hQVbMIuN/8xXeIA364o2HjbR0mtDQJrmZAz8RC3XNxP6s6cg8hBgtU RAVdS5EUl1tLR+NGRXI0ud8CARIXQ0mmanVHAZMbbYrjvDE/6Ig4IBHsnkfbwVu1rRtk zT4+eSxrLVuka/wcJ7QxBGUWCz7RtLuif41PwwnoK0MTGeWAeJdNy3B08rn+jLn2qF+9 TlnR0LgLE/y72G8FWB6cMtKMotXVB6HXdhQ5HETjAH6lKq7UL14C0NnOaCC5L7F0d/cs ICig== MIME-Version: 1.0 X-Received: by 10.66.197.135 with SMTP id iu7mr14342364pac.149.1386121511260; Tue, 03 Dec 2013 17:45:11 -0800 (PST) Received: by 10.70.50.9 with HTTP; Tue, 3 Dec 2013 17:45:11 -0800 (PST) Date: Tue, 3 Dec 2013 17:45:11 -0800 Message-ID: Subject: map join in subqueries From: Sukhendu Chakraborty To: hive-dev@hadoop.apache.org Content-Type: multipart/alternative; boundary=047d7bd8fc224b592d04ecab9010 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bd8fc224b592d04ecab9010 Content-Type: text/plain; charset=ISO-8859-1 Hi, Is there anyway mapjoin works on the subquery(not the underlying table). I have the following query: select external_id,count(category_id) from catalog_products_in_categories_orc pc inner join (select * from catalog_products_orc where s_id=118) p on pc.product_id=p.id group by external_id; Now, even though catalog_products_orc is a big table, after filtering (s_id=118) it results in very few number of rows which can be easily optimized to a mapjoin (with catalog_products_in_categories_orc as the big table and the subquery result as the small table) . However, when I try to specify /*+MAPJOIN(p)*/ to enforce this, it results in a mapjoin for the table catalog_products_orc (and not on the subquery after filtering). Any ideas to achieve mapjoin on a subquery (and not the underlying table)? -Sukhendu --047d7bd8fc224b592d04ecab9010--