Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4EF6D200BCF for ; Mon, 5 Dec 2016 20:27:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4D78A160B18; Mon, 5 Dec 2016 19:27:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 74C57160B09 for ; Mon, 5 Dec 2016 20:26:59 +0100 (CET) Received: (qmail 97332 invoked by uid 500); 5 Dec 2016 19:26:58 -0000 Mailing-List: contact issues-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 issues@hive.apache.org Received: (qmail 97302 invoked by uid 99); 5 Dec 2016 19:26:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Dec 2016 19:26:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 91BCF2C03DC for ; Mon, 5 Dec 2016 19:26:58 +0000 (UTC) Date: Mon, 5 Dec 2016 19:26:58 +0000 (UTC) From: "Jason Dere (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-15331) Decimal multiplication with high precision/scale often returns NULL MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 05 Dec 2016 19:27:00 -0000 [ https://issues.apache.org/jira/browse/HIVE-15331?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jason Dere updated HIVE-15331: ------------------------------ Attachment: HIVE-15331.1.patch Initial patch. Let's see what changes in the golden files. > Decimal multiplication with high precision/scale often returns NULL > ------------------------------------------------------------------- > > Key: HIVE-15331 > URL: https://issues.apache.org/jira/browse/HIVE-15331 > Project: Hive > Issue Type: Bug > Components: Types > Reporter: Jason Dere > Assignee: Jason Dere > Attachments: HIVE-15331.1.patch > > > {noformat} > create temporary table dec (a decimal(38,18)); > insert into dec values(100.0); > hive> select a*a from dec; > OK > NULL > Time taken: 0.165 seconds, Fetched: 1 row(s) > {noformat} > Looks like the reason is because the result of decimal(38,18) * decimal(38,18) only has 2 digits of precision for integers: > {noformat} > hive> set hive.explain.user=false; > hive> explain select a*a from dec; > OK > STAGE DEPENDENCIES: > Stage-0 is a root stage > STAGE PLANS: > Stage: Stage-0 > Fetch Operator > limit: -1 > Processor Tree: > TableScan > alias: dec > Select Operator > expressions: (a * a) (type: decimal(38,36)) > outputColumnNames: _col0 > ListSink > Time taken: 0.039 seconds, Fetched: 15 row(s) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)