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 1342BDD61 for ; Tue, 18 Dec 2012 06:52:20 +0000 (UTC) Received: (qmail 18601 invoked by uid 500); 18 Dec 2012 06:52:19 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 18563 invoked by uid 500); 18 Dec 2012 06:52:19 -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 18524 invoked by uid 500); 18 Dec 2012 06:52:18 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 18465 invoked by uid 99); 18 Dec 2012 06:52:17 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Dec 2012 06:52:17 +0000 Date: Tue, 18 Dec 2012 06:52:17 +0000 (UTC) From: "Namit Jain (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-3715) float and double calculation is inaccurate in Hive MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-3715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13534708#comment-13534708 ] Namit Jain commented on HIVE-3715: ---------------------------------- Have you looked at ArciMath BigDecimal - I have not looked at it, but casual browsing suggests it might be faster than BigDecimal. > float and double calculation is inaccurate in Hive > -------------------------------------------------- > > Key: HIVE-3715 > URL: https://issues.apache.org/jira/browse/HIVE-3715 > Project: Hive > Issue Type: Bug > Components: SQL > Affects Versions: 0.10.0 > Reporter: Johnny Zhang > Assignee: Johnny Zhang > Attachments: HIVE-3715.patch.txt > > > I found this during debug the e2e test failures. I found Hive miss calculate the float and double value. Take float calculation as an example: > hive> select f from all100k limit 1; > 48308.98 > hive> select f/10 from all100k limit 1; > 4830.898046875 <--added 04875 in the end > hive> select f*1.01 from all100k limit 1; > 48792.0702734375 <--should be 48792.0698 > It might be essentially the same problem as http://effbot.org/pyfaq/why-are-floating-point-calculations-so-inaccurate.htm. But since e2e test compare the results with mysql and seems mysql does it right, so it is worthy fixing it in Hive. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira