You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Zuo Junhao (Jira)" <ji...@apache.org> on 2020/08/13 12:55:00 UTC

[jira] [Updated] (HIVE-24038) Hive更改表中字段数据类型导致的异常

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

Zuo Junhao updated HIVE-24038:
------------------------------
    Description: 一张表有两个字段,在建表时(内部表)定义为int类型(user_role,label_type),在向该表中insert数据时,这两个字段是string类型的,由于Hive的读时校验模式,不会报错,但是在再次select的时候,对应的字段会是null;此时我 alter table xxx chanage column xxx xxx string后,再次向表中insert了一遍数据,再次select的时候,会报以下异常:Failed with exception java.io.IOException:java.lang.ClassCastException: org.apache.hadoop.io.Text cannot be cast to org.apache.hadoop.io.IntWritable

> Hive更改表中字段数据类型导致的异常
> -------------------
>
>                 Key: HIVE-24038
>                 URL: https://issues.apache.org/jira/browse/HIVE-24038
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Zuo Junhao
>            Priority: Major
>
> 一张表有两个字段,在建表时(内部表)定义为int类型(user_role,label_type),在向该表中insert数据时,这两个字段是string类型的,由于Hive的读时校验模式,不会报错,但是在再次select的时候,对应的字段会是null;此时我 alter table xxx chanage column xxx xxx string后,再次向表中insert了一遍数据,再次select的时候,会报以下异常:Failed with exception java.io.IOException:java.lang.ClassCastException: org.apache.hadoop.io.Text cannot be cast to org.apache.hadoop.io.IntWritable



--
This message was sent by Atlassian Jira
(v8.3.4#803005)