Return-Path: Delivered-To: apmail-hadoop-core-commits-archive@www.apache.org Received: (qmail 6903 invoked from network); 15 Jun 2009 21:43:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Jun 2009 21:43:36 -0000 Received: (qmail 91491 invoked by uid 500); 15 Jun 2009 21:43:47 -0000 Delivered-To: apmail-hadoop-core-commits-archive@hadoop.apache.org Received: (qmail 91409 invoked by uid 500); 15 Jun 2009 21:43:47 -0000 Mailing-List: contact core-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-commits@hadoop.apache.org Received: (qmail 91400 invoked by uid 99); 15 Jun 2009 21:43:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jun 2009 21:43:47 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jun 2009 21:43:38 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 7EC80118C0 for ; Mon, 15 Jun 2009 21:43:18 +0000 (GMT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: core-commits@hadoop.apache.org Date: Mon, 15 Jun 2009 21:43:18 -0000 Message-ID: <20090615214318.2199.51629@eos.apache.org> Subject: [Hadoop Wiki] Update of "Hive/Tutorial" by PeterSkomoroch X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification. The following page has been changed by PeterSkomoroch: http://wiki.apache.org/hadoop/Hive/Tutorial The comment on the change is: fix union example, small equi-join edit ------------------------------------------------------------------------------ WHERE pv.date = '2008-03-03'; }}} - Note that in Hive only support equi-joins. In order to do outer joins the user can qualify the join with LEFT OUTER, RIGHT OUTER or FULL OUTER keywords in order to indicate the kind of outer join (left preserved, right preserved or both sides preserved). e.g. in order to do a full outer join in the query above, the corresponding syntax would look like the following query: + In order to do outer joins the user can qualify the join with LEFT OUTER, RIGHT OUTER or FULL OUTER keywords in order to indicate the kind of outer join (left preserved, right preserved or both sides preserved). e.g. in order to do a full outer join in the query above, the corresponding syntax would look like the following query: {{{ INSERT OVERWRITE TABLE pv_users SELECT pv.*, u.gender, u.age @@ -364, +364 @@ WHERE pv.date = '2008-03-03'; }}} + Note that Hive only supports [http://en.wikipedia.org/wiki/Join_(SQL)#Equi-join equi-joins]. + == Aggregations == In order to count the number of distinct users by gender one could write the following query: @@ -450, +452 @@ {{{ INSERT OVERWRITE TABLE actions_users - SELECT u.id, actions.date; + SELECT u.id, actions.date FROM ( SELECT av.uid AS uid FROM action_video av @@ -461, +463 @@ SELECT ac.uid AS uid FROM action_comment ac WHERE ac.date = '2008-06-03' - ) actions JOIN users u ON(u.id = actions.uid) + ) actions JOIN users u ON(u.id = actions.uid); }}} == Array Operations ==