Return-Path: Delivered-To: apmail-hadoop-hive-dev-archive@minotaur.apache.org Received: (qmail 28777 invoked from network); 26 Mar 2009 21:40:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Mar 2009 21:40:11 -0000 Received: (qmail 81615 invoked by uid 500); 26 Mar 2009 21:40:11 -0000 Delivered-To: apmail-hadoop-hive-dev-archive@hadoop.apache.org Received: (qmail 81583 invoked by uid 500); 26 Mar 2009 21:40:11 -0000 Mailing-List: contact hive-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hadoop.apache.org Delivered-To: mailing list hive-dev@hadoop.apache.org Received: (qmail 81534 invoked by uid 99); 26 Mar 2009 21:40:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Mar 2009 21:40:11 +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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Mar 2009 21:40:10 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A3776234C045 for ; Thu, 26 Mar 2009 14:39:50 -0700 (PDT) Message-ID: <813073538.1238103590668.JavaMail.jira@brutus> Date: Thu, 26 Mar 2009 14:39:50 -0700 (PDT) From: "Zheng Shao (JIRA)" To: hive-dev@hadoop.apache.org Subject: [jira] Commented: (HIVE-61) Implment ORDER BY In-Reply-To: <2038151343.1226539664281.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HIVE-61?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689683#action_12689683 ] Zheng Shao commented on HIVE-61: -------------------------------- Most of the use cases with total ordering is to get the top 10. For getting the top 10, the current work-around is: First store the top 10 from each partition to some temp table: INSERT OVERWRITE tableB REDUCE a.* USING 'head -n 10' AS (col1, col2, col3, col4, ...) FROM (SELECT * FROM tableA SORT BY col3 DESC, col4 ASC) a Second, set the #reducer to 1 and get the top 10 globally. set mapred.reduce.tasks=1; SELECT * FROM tableB SORT BY col3 DESC, col4 ASC LIMIT 10 > Implment ORDER BY > ----------------- > > Key: HIVE-61 > URL: https://issues.apache.org/jira/browse/HIVE-61 > Project: Hadoop Hive > Issue Type: New Feature > Components: Query Processor > Reporter: Jeff Hammerbacher > Assignee: Zheng Shao > > ORDER BY is in the query language reference but currently is a no-op. We should make it an op. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.