From dev-return-35597-archive-asf-public=cust-asf.ponee.io@sqoop.apache.org Fri Feb 9 20:22:11 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id E0D47180654 for ; Fri, 9 Feb 2018 20:22:11 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id CFC17160C4C; Fri, 9 Feb 2018 19:22:11 +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 24657160C3C for ; Fri, 9 Feb 2018 20:22:10 +0100 (CET) Received: (qmail 86894 invoked by uid 500); 9 Feb 2018 19:22:04 -0000 Mailing-List: contact dev-help@sqoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sqoop.apache.org Delivered-To: mailing list dev@sqoop.apache.org Received: (qmail 86846 invoked by uid 99); 9 Feb 2018 19:22:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Feb 2018 19:22:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 627791A07CB for ; Fri, 9 Feb 2018 19:22:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -102.311 X-Spam-Level: X-Spam-Status: No, score=-102.311 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id erz9qUmWkIIt for ; Fri, 9 Feb 2018 19:22:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 7CF625F341 for ; Fri, 9 Feb 2018 19:22:03 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id C8D6FE0257 for ; Fri, 9 Feb 2018 19:22:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 2D11724106 for ; Fri, 9 Feb 2018 19:22:00 +0000 (UTC) Date: Fri, 9 Feb 2018 19:22:00 +0000 (UTC) From: "Greg Lindholm (JIRA)" To: dev@sqoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (SQOOP-3285) Hcatalog import is loosing precision on DECIMAL fields MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Greg Lindholm created SQOOP-3285: ------------------------------------ Summary: Hcatalog import is loosing precision on DECIMAL field= s Key: SQOOP-3285 URL: https://issues.apache.org/jira/browse/SQOOP-3285 Project: Sqoop Issue Type: Bug Components: hive-integration Affects Versions: 1.4.7 Reporter: Greg Lindholm Import with hcatalog for DECIMAL fields is loosing precision. The bug is in org.apache.sqoop.mapreduce.hcat.SqoopHCatImportHelper.convert= NumberTypes() Internally the BigDecimal value is converted to a Double then back into a B= igDecimal. As a test I imported from a MySQL db a DECIMAL(38,8) field: {code:java} create table sampledata1 ( n38 DECIMAL(38,8) ); insert into sampledata1 ( n38 ) values ( -123456789012345678901234567890.12= 345678 ) sqoop import \ =C2=A0 --connect jdbc:mysql://10.210.144.22:3306/greg --username greg -P \ =C2=A0 -m 1 \ =C2=A0 --table sampledata1 \ =C2=A0 --hcatalog-table sampledata1_orc2 \ =C2=A0 --create-hcatalog-table \ =C2=A0 --hcatalog-storage-stanza 'stored as orc' {code} The result in the hive table does not match the input. {noformat} Original: -123456789012345678901234567890.12345678 Result: -123456789012345677877719597056.00000000{noformat} I get the same result with Orc, RCfile, and Avro files. =C2=A0 I believe I found the problem and will provide a patch shortly. =C2=A0 =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)