incubator-hcatalog-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prasad B <prasadb0...@gmail.com>
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: org.apache.pig.data.DataByteArray cannot
be cast to java.lang.String

        at org.apache.hadoop.hive.serde2.objectinspector.primitive.JavaStringObjectInspector.getPrimitiveWritableObject(JavaStringObjectInspector.java:35)
	at org.apache.hadoop.hive.serde2.lazy.LazyUtils.writePrimitiveUTF8(LazyUtils.java:206)
	at org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe.serialize(LazySimpleSerDe.java:460)
	at org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe.serialize(ColumnarSerDe.java:227)
	at org.apache.hcatalog.rcfile.RCFileOutputDriver.convertValue(RCFileOutputDriver.java:79)
	at org.apache.hcatalog.mapreduce.HCatRecordWriter.write(HCatRecordWriter.java:170)
	at org.apache.hcatalog.mapreduce.HCatRecordWriter.write(HCatRecordWriter.java:39)
	at org.apache.hcatalog.pig.HCatBaseStorer.putNext(HCatBaseStorer.java:254)

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,

Prasad.

Mime
View raw message