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 CAE332009F4 for ; Thu, 26 May 2016 19:58:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C9B34160A3B; Thu, 26 May 2016 17:58: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 1DD4D160A17 for ; Thu, 26 May 2016 19:58:13 +0200 (CEST) Received: (qmail 19804 invoked by uid 500); 26 May 2016 17:58:13 -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 19775 invoked by uid 99); 26 May 2016 17:58:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 May 2016 17:58:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id EB2792C033A for ; Thu, 26 May 2016 17:58:12 +0000 (UTC) Date: Thu, 26 May 2016 17:58:12 +0000 (UTC) From: "Takahiko Saito (JIRA)" To: dev@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (HIVE-13865) Changing char column of orc table to string/var char drops white space. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 26 May 2016 17:58:14 -0000 Takahiko Saito created HIVE-13865: ------------------------------------- Summary: Changing char column of orc table to string/var char drops white space. Key: HIVE-13865 URL: https://issues.apache.org/jira/browse/HIVE-13865 Project: Hive Issue Type: Bug Affects Versions: 1.2.1 Reporter: Takahiko Saito Creating a orc table with char(16) column and insert some value with white space followed by characters: {noformat} 0: jdbc:hive2://os-r6-ifsmes-hiveserver2-11-4> create table test (c char(16)) stored as orc; No rows affected (0.1 seconds) 0: jdbc:hive2://os-r6-ifsmes-hiveserver2-11-4> insert into table test values ('horton works '); INFO : Tez session hasn't been created yet. Opening session INFO : Dag name: insert into table test values ('horton ...')(Stage-1) INFO : INFO : Status: Running (Executing on YARN cluster with App id application_1464222003837_0399) INFO : Map 1: -/- INFO : Map 1: 0/1 INFO : Map 1: 0/1 INFO : Map 1: 0/1 INFO : Map 1: 0(+1)/1 INFO : Map 1: 0(+1)/1 INFO : Map 1: 1/1 INFO : Loading data to table default.test from hdfs://os-r6-ifsmes-hiveserver2-11-5.openstacklocal:8020/apps/hive/warehouse/test/.hive-staging_hive_2016-05-26_17-43-07_098_2458959255563595485-1/-ext-10000 INFO : Table default.test stats: [numFiles=1, numRows=1, totalSize=267, rawDataSize=100] No rows affected (25.125 seconds) 0: jdbc:hive2://os-r6-ifsmes-hiveserver2-11-4> select * from test; +-------------------+--+ | test.c | +-------------------+--+ | horton works | +-------------------+--+ 1 row selected (0.077 seconds) 0: jdbc:hive2://os-r6-ifsmes-hiveserver2-11-4> describe test; +-----------+------------+----------+--+ | col_name | data_type | comment | +-----------+------------+----------+--+ | c | char(16) | | +-----------+------------+----------+--+ 1 row selected (0.153 seconds) {noformat} Then after changing the column to string, the white space is lost: {noformat} 0: jdbc:hive2://os-r6-ifsmes-hiveserver2-11-4> alter table test change column c c string; No rows affected (0.155 seconds) 0: jdbc:hive2://os-r6-ifsmes-hiveserver2-11-4> describe test; +-----------+------------+----------+--+ | col_name | data_type | comment | +-----------+------------+----------+--+ | c | string | | +-----------+------------+----------+--+ 1 row selected (0.115 seconds) 0: jdbc:hive2://os-r6-ifsmes-hiveserver2-11-4> select * from test; +---------------+--+ | test.c | +---------------+--+ | horton works | +---------------+--+ 1 row selected (0.068 seconds) {noformat} The issue is not seen with textfile formatted table: {noformat} 0: jdbc:hive2://os-r6-ifsmes-hiveserver2-11-4> create table test_text (c char(16)) stored as textfile; No rows affected (0.091 seconds) 0: jdbc:hive2://os-r6-ifsmes-hiveserver2-11-4> insert into table test_text values ('horton works '); INFO : Session is already open INFO : Dag name: insert into table test_text values ('ho...')(Stage-1) INFO : INFO : Status: Running (Executing on YARN cluster with App id application_1464222003837_0399) INFO : Map 1: 0/1 INFO : Map 1: 0(+1)/1 INFO : Map 1: 1/1 INFO : Loading data to table default.test_text from hdfs://os-r6-ifsmes-hiveserver2-11-5.openstacklocal:8020/apps/hive/warehouse/test_text/.hive-staging_hive_2016-05-26_17-45-29_669_2888061873550824337-1/-ext-10000 INFO : Table default.test_text stats: [numFiles=1, numRows=1, totalSize=17, rawDataSize=16] No rows affected (6.849 seconds) 0: jdbc:hive2://os-r6-ifsmes-hiveserver2-11-4> select * from test_text; +-------------------+--+ | test_text.c | +-------------------+--+ | horton works | +-------------------+--+ 1 row selected (0.098 seconds) 0: jdbc:hive2://os-r6-ifsmes-hiveserver2-11-4> describe test_text; +-----------+------------+----------+--+ | col_name | data_type | comment | +-----------+------------+----------+--+ | c | char(16) | | +-----------+------------+----------+--+ 1 row selected (0.127 seconds) 0: jdbc:hive2://os-r6-ifsmes-hiveserver2-11-4> alter table test_text change column c c string; No rows affected (0.145 seconds) 0: jdbc:hive2://os-r6-ifsmes-hiveserver2-11-4> describe test_text; +-----------+------------+----------+--+ | col_name | data_type | comment | +-----------+------------+----------+--+ | c | string | | +-----------+------------+----------+--+ 1 row selected (0.127 seconds) 0: jdbc:hive2://os-r6-ifsmes-hiveserver2-11-4> select * from test_text; +-------------------+--+ | test_text.c | +-------------------+--+ | horton works | +-------------------+--+ 1 row selected (0.066 seconds) {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)