Gopal, I have raised the bug (ATLAS-27).
Thanks, Devansh ________________________________________ From: Devansh Srivastava <devansh.srivast...@datametica.com> Sent: Thursday, June 18, 2015 4:05 PM To: user@hive.apache.org Subject: Re: Read error : Varchar cannot be cast to string Hi Gopal, Yes, one of the partition column is having VARCHAR as datatype. My target table has structure like this :-- CREATE EXTERNAL TABLE test_table( dob string COMMENT '', version_nbr int COMMENT '', record_status string COMMENT '', creation_timestamp timestamp COMMENT '') PARTITIONED BY ( src_sys_cd varchar(10) COMMENT '',batch_id string COMMENT '') ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS ORC LOCATION '/test/test_table'; My source table has structure like below :-- CREATE EXTERNAL TABLE test_staging_table( dob string COMMENT '', version_nbr int COMMENT '', record_status string COMMENT '', creation_timestamp timestamp COMMENT '' src_sys_cd varchar(10) COMMENT '', batch_id string COMMENT '') ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS ORC LOCATION '/test/test_staging_table'; We were loading data using pig script. Its a direct load, no transformation needed. But when i was checking test_table's data in hive. It is giving previously mentioned error. With Regards Devansh ________________________________________ From: Gopal Vijayaraghavan <go...@hortonworks.com> on behalf of Gopal Vijayaraghavan <gop...@apache.org> Sent: Wednesday, June 17, 2015 8:20 PM To: user@hive.apache.org Subject: Re: Read error : Varchar cannot be cast to string Hi, > Caused by: java.lang.ClassCastException: >org.apache.hadoop.hive.common.type.HiveVarchar cannot be cast to >java.lang.String > at >org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatchCtx.addPartitionCo >lsToBatch(VectorizedRowBatchCtx.java:566) Is it a partition column the one marked as a varchar? Can you write a small test-case and post a bug about this? I can take a look at this, looks like a simple missed call to toString(). Cheers, Gopal