Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-14005

Changing a string column of ORC table to boolean sets values to be 'NULL'

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.1.1
    • None
    • Hive
    • None

    Description

      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)
      

      The issue is NOT seen with textfile formatted table:

      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)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            taksaito Takahiko Saito
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: