Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0651218F69 for ; Tue, 30 Jun 2015 06:14:05 +0000 (UTC) Received: (qmail 58046 invoked by uid 500); 30 Jun 2015 06:14:05 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 58023 invoked by uid 500); 30 Jun 2015 06:14:04 -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 58013 invoked by uid 99); 30 Jun 2015 06:14:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Jun 2015 06:14:04 +0000 Date: Tue, 30 Jun 2015 06:14:04 +0000 (UTC) From: "Thomas Friedrich (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-10616) TypeInfoUtils doesn't handle DECIMAL with just precision specified 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-10616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14607568#comment-14607568 ] Thomas Friedrich commented on HIVE-10616: ----------------------------------------- The CLI has no issue, that's why I opened the defect against the Serializers/Deserializers component. We are using the TypeInfoUtils class (package org.apache.hadoop.hive.serde2.typeinfo) in one of our own serdes to parse the datatype and call the static method getTypeInfoFromTypeString which should treat the decimal data type according to the spec. However, if you pass in a string for the decimal type with just one argument, the precision is always 10 and the scale is 0 because the parseType method doesn't handle the one argument decimal type. You can run a simple test like this: TypeInfo t = TypeInfoUtils.getTypeInfoFromTypeString("decimal(20)"); DecimalTypeInfo dti = (DecimalTypeInfo)t; System.out.println(dti.getPrecision()); // prints 10 System.out.println(dti.getScale()); // prints 0 > TypeInfoUtils doesn't handle DECIMAL with just precision specified > ------------------------------------------------------------------ > > Key: HIVE-10616 > URL: https://issues.apache.org/jira/browse/HIVE-10616 > Project: Hive > Issue Type: Bug > Components: Serializers/Deserializers > Affects Versions: 1.0.0 > Reporter: Thomas Friedrich > Assignee: Thomas Friedrich > Priority: Minor > Attachments: HIVE-10616.1.patch > > > The parseType method in TypeInfoUtils doesn't handle decimal types with just precision specified although that's a valid type definition. > As a result, TypeInfoUtils.getTypeInfoFromTypeString will always return decimal(10,0) for any decimal() string. -- This message was sent by Atlassian JIRA (v6.3.4#6332)