Return-Path: Delivered-To: apmail-hadoop-core-commits-archive@www.apache.org Received: (qmail 7775 invoked from network); 21 Jan 2009 23:19:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Jan 2009 23:19:10 -0000 Received: (qmail 52335 invoked by uid 500); 21 Jan 2009 23:19:10 -0000 Delivered-To: apmail-hadoop-core-commits-archive@hadoop.apache.org Received: (qmail 52305 invoked by uid 500); 21 Jan 2009 23:19:10 -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 52296 invoked by uid 99); 21 Jan 2009 23:19:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Jan 2009 15:19:09 -0800 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; Wed, 21 Jan 2009 23:19:08 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 2F92A11150 for ; Wed, 21 Jan 2009 23:18:47 +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: Wed, 21 Jan 2009 23:18:47 -0000 Message-ID: <20090121231847.6268.46244@eos.apache.org> Subject: [Hadoop Wiki] Trivial Update of "Hive/HiveQL/GroupBy" by ZhengShao 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 ZhengShao: http://wiki.apache.org/hadoop/Hive/HiveQL/GroupBy ------------------------------------------------------------------------------ + [[TableOfContents]] == Group By Syntax == {{{ + groupByClause: GROUP BY groupByExpression (, groupByExpression)* + groupByExpression: expression + + groupByQuery: SELECT expression (, expression)* FROM src groupByClause? }}} - == Simple Examples == + === Simple Examples === + In order to count the number of rows in a table: + {{{ + SELECT COUNT(1) FROM table2; + }}} + In order to count the number of distinct users by gender one could write the following query: {{{ INSERT OVERWRITE TABLE pv_gender_sum