Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 43D3B7647 for ; Fri, 2 Sep 2011 16:56:43 +0000 (UTC) Received: (qmail 38249 invoked by uid 500); 2 Sep 2011 16:56:43 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 38204 invoked by uid 500); 2 Sep 2011 16:56:42 -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 38181 invoked by uid 99); 2 Sep 2011 16:56:41 -0000 Received: from reviews.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Sep 2011 16:56:41 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 37D7E1C069B; Fri, 2 Sep 2011 16:56:47 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============8459696427362381767==" MIME-Version: 1.0 Subject: Review Request: Warn user that precision is lost when bigint is implicitly cast to double in joins and unions. From: "Kevin Wilfong" To: "Siying Dong" Date: Fri, 02 Sep 2011 16:56:47 -0000 Message-ID: <20110902165647.11681.68946@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org X-ReviewRequest-URL: https://reviews.apache.org/r/1705/ Cc: "Kevin Wilfong" ,"hive" --===============8459696427362381767== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/1705/ ----------------------------------------------------------- Review request for hive and Siying Dong. Summary ------- I added checks before the type conversions for both joins and unions to eit= her throw an error or a warning depending if a bigint was going to be conve= rted to a double. I also added a new variable hive.mapred.bigint.comparison.mode, which is se= t to either strict or nonstrict to indicate whether an error or a warning s= hould be given when a bigint is converted to a double. This is instead of = the original implementation which used the variable hive.mapred.mode. This addresses bug HIVE-2427. https://issues.apache.org/jira/browse/HIVE-2427 Diffs ----- trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 1164293 = trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/ErrorMsg.java 1164293 = trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java 1= 164293 = trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeGenericFuncDesc.= java 1164293 = trunk/ql/src/test/queries/clientnegative/compare_double_bigint.q 1164293 = trunk/ql/src/test/queries/clientnegative/compare_double_bigint_join.q PRE= -CREATION = trunk/ql/src/test/queries/clientnegative/compare_double_bigint_union.q PR= E-CREATION = trunk/ql/src/test/queries/clientnegative/compare_string_bigint.q 1164293 = trunk/ql/src/test/queries/clientnegative/compare_string_bigint_join.q PRE= -CREATION = trunk/ql/src/test/queries/clientnegative/compare_string_bigint_union.q PR= E-CREATION = trunk/ql/src/test/queries/clientpositive/filter_join_breaktask2.q 1164293 = trunk/ql/src/test/results/clientnegative/compare_double_bigint.q.out 1164= 293 = trunk/ql/src/test/results/clientnegative/compare_double_bigint_join.q.out= PRE-CREATION = trunk/ql/src/test/results/clientnegative/compare_double_bigint_union.q.ou= t PRE-CREATION = trunk/ql/src/test/results/clientnegative/compare_string_bigint.q.out 1164= 293 = trunk/ql/src/test/results/clientnegative/compare_string_bigint_join.q.out= PRE-CREATION = trunk/ql/src/test/results/clientnegative/compare_string_bigint_union.q.ou= t PRE-CREATION = trunk/ql/src/test/results/clientpositive/filter_join_breaktask2.q.out 116= 4293 = Diff: https://reviews.apache.org/r/1705/diff Testing ------- I added several more tests to demonstrate the errors. I also modified a unit test in which a join was being done which involved a= comparison between a string and a bigint. I set hive.mapred.bigint.compar= ison.mode to nonstrict, so the only change was the new warning appeared in = the output. Thanks, Kevin --===============8459696427362381767==--