[ 
https://issues.apache.org/jira/browse/HIVE-14005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergio Peña updated HIVE-14005:
-------------------------------
    Target Version/s: 2.1.2  (was: 2.1.1)

> Changing a string column of ORC table to boolean sets values to be 'NULL'
> -------------------------------------------------------------------------
>
>                 Key: HIVE-14005
>                 URL: https://issues.apache.org/jira/browse/HIVE-14005
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>    Affects Versions: 2.1.1
>            Reporter: Takahiko Saito
>
> {noformat}
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2>
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2> set 
> hive.metastore.disallow.incompatible.col.type.changes=false;
> No rows affected (0.015 seconds)
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2>
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2> set 
> hive.exec.dynamic.partition.mode=nonstrict;
> No rows affected (0.003 seconds)
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2>
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2> drop table test;
> No rows affected (0.224 seconds)
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2>
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2> create table test (s string) 
> stored as orc;
> No rows affected (0.098 seconds)
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2>
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2> insert into table test values 
> ('true');
> No rows affected (1.091 seconds)
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2>
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2> select * from test;
> +---------+--+
> | test.s  |
> +---------+--+
> | true    |
> +---------+--+
> 1 row selected (0.114 seconds)
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2>
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2> alter table test change column 
> s s boolean;
> No rows affected (0.167 seconds)
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2>
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2> select * from test;
> +---------+--+
> | test.s  |
> +---------+--+
> | NULL    |
> +---------+--+
> 1 row selected (0.098 seconds)
> {noformat}
> The issue is NOT seen with textfile formatted table:
> {noformat}
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2> set 
> hive.metastore.disallow.incompatible.col.type.changes=false;
> No rows affected (0.013 seconds)
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2>
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2> set 
> hive.exec.dynamic.partition.mode=nonstrict;
> No rows affected (0.006 seconds)
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2>
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2> drop table test;
> No rows affected (0.224 seconds)
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2>
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2> create table test (s string) 
> stored as textfile;
> No rows affected (0.116 seconds)
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2>
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2> insert into table test values 
> ('true');
> No rows affected (1.799 seconds)
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2>
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2> select * from test;
> +---------+--+
> | test.s  |
> +---------+--+
> | true    |
> +---------+--+
> 1 row selected (0.085 seconds)
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2>
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2> alter table test change column 
> s s boolean;
> No rows affected (0.141 seconds)
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2>
> 0: jdbc:hive2://os-r7-rcmpc-nat-u-hiveserver2> select * from test;
> +---------+--+
> | test.s  |
> +---------+--+
> | true    |
> +---------+--+
> 1 row selected (0.093 seconds)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to