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 97C78200B0F for ; Fri, 13 May 2016 01:08:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9647C160A10; Thu, 12 May 2016 23:08:14 +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 E3D4D160939 for ; Fri, 13 May 2016 01:08:13 +0200 (CEST) Received: (qmail 47667 invoked by uid 500); 12 May 2016 23:08:13 -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 47647 invoked by uid 99); 12 May 2016 23:08:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 May 2016 23:08:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id E29CF2C1F5C for ; Thu, 12 May 2016 23:08:12 +0000 (UTC) Date: Thu, 12 May 2016 23:08:12 +0000 (UTC) From: "Hari Sankar Sivarama Subramaniyan (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-13708) Create table should verify datatypes supported by the serde MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 12 May 2016 23:08:14 -0000 [ https://issues.apache.org/jira/browse/HIVE-13708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15282227#comment-15282227 ] Hari Sankar Sivarama Subramaniyan commented on HIVE-13708: ---------------------------------------------------------- Couple of points : 1. The original document says : CREATE TABLE my_table(a string, b string, ...) ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde' I believe this supports strictly string columns and not anything else(not even variants like varchar). Please correct me if this is wrong. 2. The description for this jira says: CREATE EXTERNAL TABLE test (totalprice DECIMAL(38,10)) ROW FORMAT SERDE 'com.bizo.hive.serde.csv.CSVSerde' with There is not much we can do for 'com.bizo.hive.serde.csv.CSVSerde' in Hive. I will upload a patch that will fix for 'org.apache.hadoop.hive.serde2.OpenCSVSerde'. Thanks Hari > Create table should verify datatypes supported by the serde > ----------------------------------------------------------- > > Key: HIVE-13708 > URL: https://issues.apache.org/jira/browse/HIVE-13708 > Project: Hive > Issue Type: Bug > Components: Query Planning > Reporter: Thejas M Nair > Assignee: Hari Sankar Sivarama Subramaniyan > Priority: Critical > > As [~Goldshuv] mentioned in HIVE-7777. > Create table with serde such as OpenCSVSerde allows for creation of table with columns of arbitrary types. But 'describe table' would still return string datatypes, and so does selects on the table. > This is misleading and would result in users not getting intended results. > The create table ideally should disallow the creation of such tables with unsupported types. > Example posted by [~Goldshuv] in HIVE-7777 - > {noformat} > CREATE EXTERNAL TABLE test (totalprice DECIMAL(38,10)) > ROW FORMAT SERDE 'com.bizo.hive.serde.csv.CSVSerde' with > serdeproperties ("separatorChar" = ",","quoteChar"= "'","escapeChar"= "\\") > STORED AS TEXTFILE > LOCATION '' > tblproperties ("skip.header.line.count"="1"); > {noformat} > Now consider this sql: > hive> select min(totalprice) from test; > in this case given my data, the result should have been 874.89, but the actual result became 100001.57 (as it is first according to byte ordering of a string type). this is a wrong result. > hive> desc extended test; > OK > o_totalprice string from deserializer > ... -- This message was sent by Atlassian JIRA (v6.3.4#6332)