incubator-hcatalog-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francisco Javier Gonzalez Garcia <francisco.gonza...@altran.es>
Subject Re: Error in HCatStorer
Date Thu, 28 Jun 2012 09:18:17 GMT
Yes, my pig code is:

REGISTER /usr/local/hcat/share/hcatalog/*.jar;
REGISTER /usr/lib/hive-0.9.0/lib/*.jar;

DEFINE HCatStorer org.apache.hcatalog.pig.HCatStorer();
p1 = LOAD 'prueba.txt' USING PigStorage(',');
p2 = FOREACH p1 GENERATE $0 as cmp1:chararray;
store p2 into 'Indisposiciones.prueba' using HCatStorer();

I have create a database:
CREATE DATABASE Indisposiciones LOCATION
'hdfs://deimos:9000/IndisposicionesBTS'

an then I have create a table:
USE Indisposiciones;
CREATE TABLE prueba (
   cmp1 STRING
)
STORED AS RCFILE;

I execute pig pru.pig and return the next error:

2012-06-28 11:01:40,619 [main] INFO
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher
- Failed!
2012-06-28 11:01:40,632 [main] ERROR org.apache.pig.tools.grunt.GruntParser
- ERROR 2997: Unable to recreate exception from backed error:
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)



2012/6/27 Rajesh Balamohan <rajesh.balamohan@gmail.com>

> did you register the jar files in your pig code?
>
> On Jun 27, 2012 5:52 PM, "Francisco Javier Gonzalez Garcia" <
> francisco.gonzalez@altran.es> wrote:
> >
> > I have a simple pig code that It use HCatStorer, the map task associated
> with HCatStorer return next error,
> > Could someone tell me what am I doing wrong and how to fix the problem?
> > Thanks.
> >
> > Error: java.lang.ClassNotFoundException:
> org.apache.hadoop.hive.ql.metadata.HiveStorageHandler
> > at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
> > at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
> > at java.security.AccessController.doPrivileged(Native Method)
> > at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
> > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
> > at java.lang.ClassLoader.defineClass1(Native Method)
> > at java.lang.ClassLoader.defineClass(ClassLoader.java:787)
> > at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
> > at java.net.URLClassLoader.defineClass(URLClassLoader.java:447)
> > at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
> > at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
> > at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
> > at java.security.AccessController.doPrivileged(Native Method)
> > at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
> > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
> > at
> org.apache.hcatalog.pig.HCatStorer.setStoreLocation(HCatStorer.java:81)
> > at
> org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputFormat.setLocation(PigOutputFormat.java:170)
> > at
> org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputCommitter.setUpContext(PigOutputCommitter.java:112)
> > at
> org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputCommitter.getCommitters(PigOutputCommitter.java:86)
> > at
> org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputCommitter.<init>(PigOutputCommitter.java:66)
> > at
> org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputFormat.getOutputCommitter(PigOutputFormat.java:279)
> > at org.apache.hadoop.mapred.Task.initialize(Task.java:515)
> > at org.apache.hadoop.mapred.MapTask.run(MapTask.java:353)
> > at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
> > at java.security.AccessController.doPrivileged(Native Method)
> > at javax.security.auth.Subject.doAs(Subject.java:415)
> > at
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121)
> > at org.apache.hadoop.mapred.Child.main(Child.java:249)
> >
> >
>
>

Mime
View raw message