You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Rishav Rohit (JIRA)" <ji...@apache.org> on 2013/10/15 16:08:43 UTC

[jira] [Commented] (HIVE-5545) HCatRecord getInteger method returns String when used on Partition columns of type INT

    [ https://issues.apache.org/jira/browse/HIVE-5545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13795206#comment-13795206 ] 

Rishav Rohit commented on HIVE-5545:
------------------------------------

I am posting here my Hive table data and MapReduce code alongwith Error thrown:

cat test_data
2013,1,1
2013,1,3
2013,2,18
2013,2,20
2013,3,30
2013,3,31

create schema test;
use test;

### This is temporary table
create table unpar (
year INT, 
month INT, 
day INT)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' 
STORED AS TEXTFILE;

LOAD DATA LOCAL INPATH "test_data" OVERWRITE INTO TABLE test.unpar;

### This is input table and I will try to read "year" column using HCatalog.
create table par 
(day  INT)
PARTITIONED BY (year INT, month INT )
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' 
STORED AS TEXTFILE;

INSERT OVERWRITE TABLE par PARTITION(Year, Month) SELECT day, year, month from unpar;

### this is output table
create table out
(year INT,
cnt INT)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' 
STORED AS TEXTFILE;

> HCatRecord getInteger method returns String when used on Partition columns of type INT
> --------------------------------------------------------------------------------------
>
>                 Key: HIVE-5545
>                 URL: https://issues.apache.org/jira/browse/HIVE-5545
>             Project: Hive
>          Issue Type: Bug
>          Components: HCatalog
>    Affects Versions: 0.11.0
>         Environment: hadoop-1.0.3
>            Reporter: Rishav Rohit
>
> HCatRecord getInteger method returns String when used on Partition columns of type INT.
> java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer



--
This message was sent by Atlassian JIRA
(v6.1#6144)