It looks like you don't have the cassandra libraries in your classpath. Are you in the contrib/pig directory of the cassandra source and are you running bin/pig_cassandra? That is a script that puts everything you need from cassandra into the classpath. That would be the first thing to try, if you aren't using that script already. At first try it with the -x local flag too to make sure that it's not an issue with trying to distribute it out to your hadoop cluster.
The other reason you might be getting that is that if you're running the script in mapreduce mode, it's going to try to distribute it out to your hadoop custer and your task trackers are going to need a couple of jars in their classpath as well. Take a look at http://wiki.apache.org/cassandra/HadoopSupport#ClusterConfig if you want to run it in mapreduce mode. On Aug 1, 2011, at 2:41 AM, Shai Harel wrote: > thanks for the help, i'v tried to be conservative and i'm using pig 0.8 & > cassandra 0.8 > and still getting this error > > Pig Stack Trace > --------------- > ERROR 2998: Unhandled internal error. Could not initialize class > org.apache.cassandra.thrift.SliceRange > > java.lang.NoClassDefFoundError: Could not initialize class > org.apache.cassandra.thrift.SliceRange > at org.apache.cassandra.hadoop.pig.CassandraStorage.setLocation(Unknown > Source) > at > org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.getJob(JobControlCompiler.java:369) > at > org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.compile(JobControlCompiler.java:256) > at > org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.launchPig(MapReduceLauncher.java:147) > at > org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.execute(HExecutionEngine.java:378) > at > org.apache.pig.PigServer.executeCompiledLogicalPlan(PigServer.java:1198) > at org.apache.pig.PigServer.storeEx(PigServer.java:874) > at org.apache.pig.PigServer.store(PigServer.java:816) > at org.apache.pig.PigServer.openIterator(PigServer.java:728) > at > org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:612) > at > org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:303) > at > org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165) > at > org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:141) > at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:76) > at org.apache.pig.Main.run(Main.java:465) > at org.apache.pig.Main.main(Main.java:107) > > does anyone else have this problem? > > > On Sun, Jul 31, 2011 at 2:04 PM, Jeremy Hanna > <jeremy.hanna1...@gmail.com>wrote: > >> Try following this and see if it helps getting started: >> https://github.com/jeromatron/pygmalion/wiki/Getting-Started >> >> I haven't tried it with 0.9 yet but I plan to this week. We use the >> CassandraStorage jar in production. If you can, validate your data with >> Cassandra's schema validators. CassandraStorage gets the schema from >> Cassandra and tries to unmarshal the data into Pig data types with the >> schema information. >> >> See if that helps. >> >> On Jul 31, 2011, at 9:48 AM, Shai Harel wrote: >> >>> hey all, i'v been trying to query cassandra using my pig script, >>> so i used the contrib jar from cassandra. and i'm getting the following >>> error... >>> some thrift failure err.... :| >>> >>> ERROR 2998: Unhandled internal error. >>> org.apache.thrift.meta_data.FieldValueMetaData.<init>(BZ)V >>> >>> java.lang.NoSuchMethodError: >>> org.apache.thrift.meta_data.FieldValueMetaData.<init>(BZ)V >>> at >> org.apache.cassandra.thrift.SliceRange.<clinit>(SliceRange.java:149) >>> at >> org.apache.cassandra.hadoop.pig.CassandraStorage.setLocation(Unknown >>> Source) >>> at >>> >> org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.getJob(JobControlCompiler.java:369) >>> at >>> >> org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.compile(JobControlCompiler.java:256) >>> at >>> >> org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.launchPig(MapReduceLauncher.java:147) >>> at >>> >> org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.execute(HExecutionEngine.java:378) >>> at >>> org.apache.pig.PigServer.executeCompiledLogicalPlan(PigServer.java:1198) >>> at org.apache.pig.PigServer.storeEx(PigServer.java:874) >>> at org.apache.pig.PigServer.store(PigServer.java:816) >>> at org.apache.pig.PigServer.openIterator(PigServer.java:728) >>> at >>> org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:612) >>> at >>> >> org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:303) >>> at >>> >> org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165) >>> at >>> >> org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:141) >>> at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:76) >>> at org.apache.pig.Main.run(Main.java:465) >>> at org.apache.pig.Main.main(Main.java:107) >>> >>> >>> does anyone managed to get this up and running? >>> i'm considering to rewrite the CassandraStorage.jar using Hector, >>> Any thoughts about that? >> >>