Return-Path: Delivered-To: apmail-hadoop-hive-dev-archive@minotaur.apache.org Received: (qmail 55295 invoked from network); 10 Aug 2010 07:22:44 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 10 Aug 2010 07:22:44 -0000 Received: (qmail 5209 invoked by uid 500); 10 Aug 2010 07:22:44 -0000 Delivered-To: apmail-hadoop-hive-dev-archive@hadoop.apache.org Received: (qmail 5024 invoked by uid 500); 10 Aug 2010 07:22:42 -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 5012 invoked by uid 99); 10 Aug 2010 07:22:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Aug 2010 07:22:41 +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.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Aug 2010 07:22:39 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o7A7MH6x022335 for ; Tue, 10 Aug 2010 07:22:17 GMT Message-ID: <12078120.249631281424937151.JavaMail.jira@thor> Date: Tue, 10 Aug 2010 03:22:17 -0400 (EDT) From: "Amareshwari Sriramadasu (JIRA)" To: hive-dev@hadoop.apache.org Subject: [jira] Commented: (HIVE-741) NULL is not handled correctly in join In-Reply-To: <205386759.1249704014784.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-741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12896789#action_12896789 ] Amareshwari Sriramadasu commented on HIVE-741: ---------------------------------------------- bq. When 'null' is replaced by '' it works. I see the same result even if 'null' is replaced with ''. To reproduce the above, I created a table input1 with {code} hive> create table input1 (key int, value int); {code} Loaded the following input using Load data command {noformat} in.txt ^A35 12^A 10^A1000 10^A100 100^A100 {noformat} I see the following output for join queries executed. {noformat} hive> select * from input1 a join input1 b on a.key=b.value; Output: NULL 35 12 NULL 100 100 10 100 100 100 100 100 Expected Output: 100 100 10 100 100 100 100 100 hive> select * from input1 a left outer join input1 b on a.key=b.value; OUTPUT: NULL 35 12 NULL 10 1000 NULL NULL 10 100 NULL NULL 12 NULL NULL NULL 100 100 10 100 100 100 100 100 Expected Output: NULL 35 NULL NULL 10 1000 NULL NULL 10 100 NULL NULL 12 NULL NULL NULL 100 100 10 100 100 100 100 100 hive> select * from input1 a right outer join input1 b on a.key=b.value; OUTPUT: NULL 35 12 NULL NULL NULL NULL 35 100 100 10 100 100 100 100 100 NULL NULL 10 1000 ExpectedOutput: NULL NULL NULL 35 NULL NULL 12 NULL 100 100 10 100 100 100 100 100 NULL NULL 10 1000 {noformat} Expected output is obtained from mysql db for a similar query. Ning, if you are not working on the fix for this, I would like to contribute. Would need your help understanding join code also, as I'm a new to hive. > NULL is not handled correctly in join > ------------------------------------- > > Key: HIVE-741 > URL: https://issues.apache.org/jira/browse/HIVE-741 > Project: Hadoop Hive > Issue Type: Bug > Reporter: Ning Zhang > Assignee: Ning Zhang > > With the following data in table input4_cb: > Key Value > ------ -------- > NULL 325 > 18 NULL > The following query: > {code} > select * from input4_cb a join input4_cb b on a.key = b.value; > {code} > returns the following result: > NULL 325 18 NULL > The correct result should be empty set. > When 'null' is replaced by '' it works. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.