Return-Path: Delivered-To: apmail-hive-dev-archive@www.apache.org Received: (qmail 55369 invoked from network); 23 Dec 2010 18:27:13 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Dec 2010 18:27:13 -0000 Received: (qmail 84863 invoked by uid 500); 23 Dec 2010 18:27:13 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 84822 invoked by uid 500); 23 Dec 2010 18:27:13 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 84814 invoked by uid 500); 23 Dec 2010 18:27:12 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 84811 invoked by uid 99); 23 Dec 2010 18:27:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Dec 2010 18:27:12 +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; Thu, 23 Dec 2010 18:27:10 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oBNIQnMp015974 for ; Thu, 23 Dec 2010 18:26:49 GMT Message-ID: <19481553.1161293128809098.JavaMail.jira@thor> Date: Thu, 23 Dec 2010 13:26:49 -0500 (EST) From: "Edward Capriolo (JIRA)" To: hive-dev@hadoop.apache.org Subject: [jira] Assigned: (HIVE-1863) Boolean columns in Hive tables containing NULL are treated as FALSE by the Hive JDBC driver. In-Reply-To: <12641158.281881293076981206.JavaMail.jira@thor> 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-1863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Edward Capriolo reassigned HIVE-1863: ------------------------------------- Assignee: Edward Capriolo > Boolean columns in Hive tables containing NULL are treated as FALSE by the Hive JDBC driver. > -------------------------------------------------------------------------------------------- > > Key: HIVE-1863 > URL: https://issues.apache.org/jira/browse/HIVE-1863 > Project: Hive > Issue Type: Bug > Components: Drivers > Affects Versions: 0.5.0 > Reporter: Guy le Mar > Assignee: Edward Capriolo > > (1) Using the Hive CLI, create a table using... > create table dt4_boolean > ( > dt4_id int, > dt4_testbool boolean, > dt4_string string > ) > row format delimited > fields terminated by ',' > lines terminated by '\n'; > (2) Create a file containing the following text... > 1,true,Value is True > 2,null,Data says null and must be null > 3,,No value that means null > 4,NoIdea,Data says NoIdea that's gonna be null > 5,false,Value is FALSE > (3) Load the data in the file into the Hive table... > load data local inpath '' overwrite into table dt4_boolean; > (4) Check the table works as expected using the Hive CLI... > hive> select * from dt4_boolean; > OK > 1 true Value is True > 2 NULL Data says null and must be null > 3 NULL No value that means null > 4 NULL Data says NoIdea that's gonna be null > 5 false Value is FALSE > Time taken: 0.049 seconds > (5) Using the Hive JDBC driver, execute the same Hive query (select * from dt4_boolean) > (5.1) The "row_str" values obtained by the Hive JDBC driver for deserialization are correct... > 1 true Value is True > 2 NULL Data says null and must be null > 3 NULL No value that means null > 4 NULL Data says NoIdea that's gonna be null > 5 false Value is FALSE > (5.2) However, when these "row_str" are deserialized by the DynamicSerDe to a java.lang.Object, the NULL boolean values are converted to FALSE - instead of being null. > As a consequence, the application making use of the Hive JDBC driver produces this (incorrect) output... > SQL> select dt4_id, dt4_testbool from dt4_boolean; > DT4_ID DT4_TESTBOOL > ---------- ------------ > 1 true > 2 false > 3 false > 4 false > 5 false > ...instead of producing this (correct) output... > SQL> select dt4_id, dt4_testbool from dt4_boolean; > DT4_ID DT4_TESTBOOL > ---------- ------------ > 1 true > 2 NULL > 3 NULL > 4 NULL > 5 false -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.