Return-Path: X-Original-To: apmail-hive-user-archive@www.apache.org Delivered-To: apmail-hive-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 269C318FAB for ; Thu, 4 Jun 2015 21:56:05 +0000 (UTC) Received: (qmail 15056 invoked by uid 500); 4 Jun 2015 21:56:03 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 14991 invoked by uid 500); 4 Jun 2015 21:56:03 -0000 Mailing-List: contact user-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hive.apache.org Delivered-To: mailing list user@hive.apache.org Received: (qmail 14976 invoked by uid 99); 4 Jun 2015 21:56:03 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Jun 2015 21:56:03 +0000 Received: from [10.200.0.58] (184-23-216-210.dedicated.static.sonic.net [184.23.216.210]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 7990F1A051B for ; Thu, 4 Jun 2015 21:56:01 +0000 (UTC) User-Agent: Microsoft-MacOutlook/14.5.1.150515 Date: Thu, 04 Jun 2015 14:55:58 -0700 Subject: Re: Top N query From: Gopal Vijayaraghavan Sender: Gopal Vijayaraghavan To: "user@hive.apache.org" Message-ID: Thread-Topic: Top N query References: In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit > I does't understand about your solution. Could you please provide exact >query? ... GROUP BY recommend_ratings2.movieid ORDER BY Measure_0 DESC limit 2 ) T_0 ON ( recommend_ratings2.movieid <=> T_0.movieid_0) Follow the docs on the mysql impl of the space-ship operator - The hive impl follows the same rules which is (a.x = b.x) OR (a.x is NULL and b.x is NULL). AFAIK, most of the complex optimizations are turned off in the presence of null-safe operators. Cheers, Gopal