incubator-hcatalog-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prasad B <>
Subject reg conversion between Pig bytearray and HCatalog/Java "String"
Date Thu, 29 Mar 2012 22:03:12 GMT
Hello All,

After registering the thrift and hive metastore (in fact all) jars in the
pig script, the following casting error is reported:

java.lang.ClassCastException: cannot
be cast to java.lang.String

        at org.apache.hadoop.hive.serde2.objectinspector.primitive.JavaStringObjectInspector.getPrimitiveWritableObject(
	at org.apache.hadoop.hive.serde2.lazy.LazyUtils.writePrimitiveUTF8(
	at org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe.serialize(
	at org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe.serialize(
	at org.apache.hcatalog.rcfile.RCFileOutputDriver.convertValue(
	at org.apache.hcatalog.mapreduce.HCatRecordWriter.write(
	at org.apache.hcatalog.mapreduce.HCatRecordWriter.write(
	at org.apache.hcatalog.pig.HCatBaseStorer.putNext(

The version of the "pig" is 0.9.2 and the script reads as:

register /usr/local/hcat/share/hcatalog/lib/*.jar;

A = load '/etc/passwd' using PigStorage(':');

B = foreach A generate $0 as line:chararray;
STORE B INTO 'unix_users' USING  org.apache.hcatalog.pig.HCatStorer();

and there is just one column in 'unix_users' of type 'String' and was
created as

CREATE TABLE unix_users (line STRING);

Any suggestions to fix the problem ?

thank you,


View raw message